C++ Coding Standards - Herb Sutter and Andrei Alexandrescu

This is the second book I've read in the bright-red-with-yellow "C++ In-depth Series" (the other being Exceptional C++), and I've suddenly found them ubiquitous. They seem to have replaced Meyers's books as the bog-standard "writing non-crap C++" books. I'm not exactly sure when this happened.

It does seem to have spelt a change in what good C++ is. At the time of standardisation, it seemed like everything was thrown in without real understanding. And that's on the standardisation side, let alone from the "programmer on the street" point of view. People go nuts, do really horrible things, and then Essential C++ etc. come out. The basic thing those books was to ignore the complex stuff and write something akin to C with objects. Anyway, that's what I've been doing.

So, I think the "C++ In-depth Series" (series editor, ahem, Bjarne Stroustrup) is basically saying "the high-priests of C++ have had their fights, played about with the tools available, and have decided what The Correct Idiom is". So, these books separate what is a sensible and valuable technique from a mis-use of powerful feature. Of course, the fact that it's taken so long to get to this state, and decide whether something is Really Good or Really Bad is because much of the language is twisted and misfeatured. They're discovering that what people want is something suspiciously like a functional language, but that C++ is a dreadful place to start. It's even got to the point that C++ Coding Standards repeatedly recommends using Boost's Lambda library to post-hoc twist the language into providing anonymous functions.

Reading this book after Exceptional C++ really does drive home what the favoured techniques are, since the points do get repeatedly (fairly pointedly). It's quite amusing, since it's basically something like four people writing billions of books and articles referencing each other that create this consensus, but there we go. C++ now has its Standard Idioms, and they're so obvious that even I, who has never joined ACCU, can spot them. So, my New Year's resolution is to write Real C++ (now with added idioms), even if I think it's slightly grim.

Oh, and the book? It's a strange mixture of obvious development and coding standards and the C++ idioms that are apparently the Right Way. So, for me, a mixture of the obvious and actually useful. I expect it's going to be the same for quite a lot of non-expert C++ programmers. And for expert C++ programmers, it may well be a quite good book to fill out their bookshelf and wave at those less indoctrinated than themselves (as my boss has done for me :).

Posted 2006-01-02.