Tuesday, June 12, 2007

The problem with C++

Really, there are two big problems with this language

  1. How it is taught -- or more often, self-taught, as universities these days seem to teach Java (and that not very well, in my experience supervising undergraduates).  Too often it is introduced as 'C'; then the syntax of classes and templates introduced.  The most important parts of the language -- the Standard Library, and the expected idioms -- get short shrift, most time and energy spent on the (admittedly complicated) grammar.  One of the few books that makes a good stab at the topic is Koenig and Moo's Accelerated C++.
  2. The compiler support -- while gcc and Borland compilers have kept abreast of the language, Visual C++ 2005 is the first Microsoft compiler that has enough template support to compile things like Andrei Alexandrescu's Loki library that Borland handled around the turn of the century -- and the vendor compilers on some of the Unix platforms I have had to use were seriously stuck in the early 1990s (the developer tools suite on AIX, c2001).

Between these two, we accumulate a lot of 'C'-with-classes -- which gives the language an undeservedly bad reputation in many circles.

No comments :