C++ and Sanity
These days, I rarely do anything above hardware-level programming. So I rarely have to look at the current state of C++, except out of exigency or curiousity. When I do, I’m usually stunned by the changes.1 They tend to be, at the same time, boggling, insane, and perfect.
It’s not unusual to see someone adopt a set of principles, then hold on to them beyond the bounds of reason. It’s less common to see someone drive their principles so far into insanity that they come out the other side and make sense. Somewhere in Tom Stoppard’s Rosenkrantz & Guildenstern are Dead, the pair try confusedly to evaluate Hamlet’s state of mind and end up describing him as “stark, staring sane”. It’s like that.
It started, I imagine, with Bjarne Stroustrup’s obviously mad idea, that C could become a full-fledged object-oriented language, without losing any of the utility of C, and in which user-defined data types could operate and perform exactly like built-in types. Ha! As if.
The people who followed his path had something of the same attitude. I’d call it a refusal to compromise with reality, combined with determination to make reality do the compromising. I remember when ANSI C was a draft, noticing something and mentioning it to a committee member. It was like this, though the details may not be exact. If you declared
void f(struct s *p);
without previously declaring struct s
, the compiler was happy to take it, but it was impossible then to define struct s
, or f()
, or to write a legal call to it.
I assumed this was an oversight, and could be fixed. The committee member told me, “Yes, that’s what we wrote, and that’s what we meant.”
Anyhow, C++ has changed, step by logical step, until it has become something else entirely; a sort of metaprogramming language. And it’s still C. It’s as if you started with a bicycle and improved it, a step at a time, until you had a tractor-trailer that could still function perfectly well as a bicycle.
I don’t have a real conclusion for this diatribe. Maybe it’s just that, in a world that seems less sane to me day by day, it’s comforting to see that my idea of the limits of sanity is not a universal guide.
-
See also Henri Michaux, “Still More Changes” (Encore des Changements2). ↩︎
-
Pure puffery. I only know enough French to … no, I don’t even know that much. ↩︎