Friday, May 9, 2014

Thoughts on programming language debates

By and large, they're pointless.

Yes programming languages are an important part of computer science and software engineering.  But sometimes I get the impression a lot of people think programming languages == CS & SE.  I would argue that languages are an implementation of ideas from CS and SE (i.e. paradigms), and little more.  We get so wrapped up in the whole "this language vs. that language" thing that I think we tend to forget that the ideas behind a programming language are far more important than the language itself.

Let's take the classic C++ vs Java debate.  Personally, I prefer Java.  This is basically for two reasons:

1.) I find Java easier to debug.  For example, dereferencing a null pointer in C++ usually gives the classic SEGFAULT, with little information about why.  Java gives a concise NullPointerException, with a corresponding line number in the code.

2.) I tend to discover that Java has an easier-to-use and more complete set of libraries.  The libraries in Java are documented in a single place for the most part (I don't really see this with C++).  I also tend to find that the standard libraries in Java have more useful and easier to remember semantics than C++.

But let's notice something about these two characteristics: they are not really definitive of the programming languages themselves, but rather the system by which they are implemented.  The fact that Java is easier to debug arises from it being run in a virtual machine, rather than natively on machine hardware.  C++ could, in principle, be made to run this way to make it easier to debug.  Similarly, one could imagine a good samaritan coming along the remaking the C++ STL to be easier to use and understand.  The point I'm trying to make is that it's the sort of side features, not the actual language, that often makes for a determination of which is better.  If you compare the syntax and semantics of the core of the two languages, they are very, very, very similar in my opinion (such that I was able to pick up C++ quite easily from knowing Java).

If I may make a car analogy, what people generally like about and use to distinguish between cars are external features.  Things like the interior (even it's freakin color), dash displays, and how the car looks on the outside.  Performance of the vehicle is important to some people too, but generally only from an outside view - most just don't care what the engine actually looks like on the inside, since they have no reason to look.

No comments:

Post a Comment