I’ve been using C and C++ for over twenty years now, and I’m very fluent in both of them. C++ has been my preferred language for pretty much any programming task for most of that time, and I haven’t seen any point to learning other programming languages because some of them are at best equivalent in power to C++, and most are noticeably poorer.
However, as I described a few days ago, I decided to learn Lisp, primarily because Paul Graham insists that it’s the most powerful language out there. I couldn’t see that it was any more powerful than C++, but enough smart people seemed to agree with Paul that I had to admit that I could be wrong on that score.
Well, I just finished chapter nine of Practical Common Lisp, and I’m finally convinced.
Up until now, everything that I’d seen done in Lisp could easily be done in C++ too. The only real difference was a little more verbosity. But the unit-testing framework that was developed in that chapter… while I think I could do the same thing in C++ with the Boost library, template functions, function pointers, and a C-style macro, it still wouldn’t be nearly as elegant as the Lisp version, and it would be noticeably more verbose. And it would require some fairly esoteric C and C++ features, things that even I — a fluent user with decades of experience behind me — would have to delve into reference works to figure out, whereas it uses only standard features of the Lisp language. It would also take me about the same amount of coding time in both languages, which considering my very different levels of expertise in them, is another big win for Lisp.
I’m still planning to use C++ for most of my professional work — I worked long and hard for the kind of expertise that I have in it, and all of my professional tools are geared toward it as well. But Lisp is definitely going to play a big part in my personal programming from now on, and likely in the prototyping stages of my professional code as well.