Main Content

Programming languages - a comparison

Archive - Originally posted on "The Horse's Mouth" - 2005-05-20 10:07:55 - Graham Ellis

"It would take me a week to develop application XXX in C, 2 or 3 days in Java, and a day in Perl, PHP, or Python."

So I say when I'm teaching Perl, PHP or Python.

What do I say when I'm teaching C, C++ or Java? The same thing! But there are qualifications / differences / reasons and just because it takes much longer to develop a new application in C or Java, it doesn't mean that you shouldn't do it.

Perl, PHP and Python are all excellent languages for developing "glueware" code - and the majority of applications these days are what I describe as "glueware". That's data manipulation scripts, web server code for mining information from and updating databases, and so on and so forth.

I don't describe major system development as glueware though - for example, if I was developing a major banking system I wouldn't call it a glueware application and I might be tempted to look at a language such as Java or C++. Why, when I've already stated that Java is so much slower to develop? It's because Java is much more controllable - in other words, the encapsulation and interfacing is much more tightly defined and you can have separate developers write and test each building block, then expose only the necessary minimum of methods and code to the users of that building block. Maintenance should be easier, and code re-usabiity much higher, which goes quite some way to compensate for the extra development time. But Java code doesn't run particularly fast - so it might NOT be the answer for systems that are going to be heavily loaded.

C programs are written at a level that's much "closer" to the machine - this gives them the advantage that they're able to be very clever and to run faster - if you put the effort in - than any of the other languages that I've mentioned. And C++ builds on top of C to give a fast, close yet Object Oriented language - at the expense of some complexity and the need for a great deal of care and testing of code to ensure that you don't have "memory leaks" and the like. C remains an excellent choice for system level software and C++ for major systems and application suites that are going to be run on huge systems or in their thousands - where the cost of the slower coding can be offset against a very high utilisation in one way or another.