Wednesday 11 March 2009

In my job, I have to use several programming languages. Normally several a day. I've looked at asp, java, informix 4gl so far today, and it's not even lunchtime!

I'm not a programming snob, I do like some of the things "bad" languages do and detest some of the things "good" languages do.

For example - Visual Basic is generally regarded as a Bad Thing, but the fact that 'true = -1' is a brilliant coup. I'm sure C/Java programmers will read that with horror, but the fact is, if true = -1 then logical and bitwise are the same. Effectively, there's no need for having | and || to represent bit-wise and logical or statements because they are one and the same. I'm not saying that Visual Basic is good in general (it's not), but this is simply a better way of doing it.

Java's generally regarded as a Good Thing, but its error handling is one of its worst features. In theory, it provides wonderful error handling. In practice, everyone who writes library modules throws runtime exceptions instead of requiring those exceptions to be caught. This is wrong and leads to buggy code and vast error stacks that spit out Pythonesque gibberish that bear little relevance to the actual problem. I think designers don't throw normal exceptions because it breaks the "black box" model. But the black box model is decidedly broken in Java anyway, with objects merging, passing black box objects into other black boxes, and other problems.

No comments: