Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The task of preprocessing before actual compilation can be extraordinarily complex. Very shortly after I learned C, I heard a lecture on a new language called C++. Everyone in the hall chuckled when the speaker revealed the name, which means ``increment C''. The first implementation of C++ was not a compiler. A tool called cfront translated C++ source code to C. The complete chain of tools was therefore: macro preprocessor, cfront, C compiler, assembler. The trick of reducing a new problem to a well understood problem is one we'll see over and over again in the language implementation realm.

C++ was more expressive than C in that C++ programs could express things more easily and with fewer lines. C++ also promoted more code reuse than C. Unfortunately, C++'s libraries were so anemic in those days that I ended up being not that much more productive in C++. Object-oriented programming in itself promotes code reuse, but productivity is more about reusing somebody else's robust and efficient code. In the late 1980s, a friend introduced me to Smalltalk, another object-oriented language that had just that: extensive libraries.

...