web developer & system programmer

coder . cl

ramblings and thoughts on programming...

is programming for everyone?

published: 14-06-2012 / updated: 14-06-2012
posted in: development, programming, rants, tips
by Daniel Molina Wegener

This seems to be a huge discussion. There have been a long time companies trying to create the ultimate programming language that can be used by almost anyone, with many fails thought. The closest attempt to success, is just to keep people more interested on how to make better applications and make them to try other programming languages harder to write, also keep their interested in more complex topics. Seems that there are two forces, one trying to keep people interested in deep knowledge about programming with a good theoretical background and other one to keep people ignorant, just trying to make their life easier, but not at all, mainly once they face complex problems.

I have seen the following comment about certain technology in a mailing list.

[…] allow to better focus on the business logic of the system, rather than of worrying about the code itself […]

I really cannot imagine someone does good programming without care about the code. Humanity still require too much research on both natural language processing, linguistics and algorithms to reach that greedy goal of having a programming language that anyone can use. Mainly because systems are becoming more complex and distributed along the time. Still the classic P = NP is not solved, so we are solving many complex problems using parallel computing and distributed computing. So, you should start caring about what is being used, as we see many systems that were used only the corporate environment — like message queues and job queues — in applications that are common in our life. You may say that Facebook uses PHP, but do you know that they are only using PHP as their code base and it is really a variant of PHP?. They do not use the Zend Engine, they are using HipHop PHP.

How many web sites are written in PHP being cracked per day? Every five seconds a site gets cracked. I can guess that most of them are written in PHP, but they are open source applications like WordPress, Joomla and similar ones, which are subject to malicious attacks due to poorly programmed extensions and wrong configurations. Do you think that you must not take care about the code?. Another example is the fact that there are is a common error that is present everywhere — where the type system is not strong-static — that is the null reference.

I call it my billion-dollar mistake. It was the invention of the null reference in 1965. At that time, I was designing the first comprehensive type system for references in an object oriented language (ALGOL W). My goal was to ensure that all use of references should be absolutely safe, with checking performed automatically by the compiler. But I couldn’t resist the temptation to put in a null reference, simply because it was so easy to implement. This has led to innumerable errors, vulnerabilities, and system crashes, which have probably caused a billion dollars of pain and damage in the last forty years. [Hoare, Tony (2009-03-09). «Null References: The Billion Dollar Mistake»]

On the standard PHP implementation a null reference can lead to a single run time error or exception. Do you know what happens on C and C++ code with null references? Can you imagine what can happen to your application if you pass a null reference in HipHop PHP? Do you think that you must not take care about the code?. Some tools that can help are static analyzers, on Java you have various open source static analyzers, like FindBugs, PMD and CheckStyle. On C and C++, also you have various tools doing that job, like Splint, Frama-C among other ones like PVS-Studio. They can help you to avoid the null reference problem among other problems which are present on that kind of code. At the other side, Haskell with its strong-static type system do not have the null reference problem, because there are not null references in the language itself, you can use null references only declaring them using the Maybe Monad, which brings real type safety, avoiding some programming mistakes.

But not everything is related to how are the instructions placed in the code or logic errors. There are also design errors and mistakes. Someone with the wrong theoretical basis who must implement a workflow and does not have any idea about automata theory, will use if statements instead of dynamic programming and state machines, bringing messy, duplicate and very nested code. So, theoretical background is required to implement a good design.

No coments yet.

post a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>