The Foundations at the Core of C++ are Wrong — Part 8

Ianjoyner
5 min readJul 4, 2024

--

This is the eighth of a series of articles examining Bjarne Stroustrup’s writings about the core foundations in C++. The first part is here with links to the other parts:

Part 7

Whom do we kill?

Chapter 2 (3rd and 4th editions) starts with a quote from Shakespeare’s Henry VI, part II: “The first thing we do, let’s kill all the language lawyers.” Wait no so fast, they are really need to interpret all the strange cases of C++. C++ breeds language lawyers. Many of them have found nice positions in subsequent standards for C++. No, I take it back, kill them after all! But let’s dig deeper into this piece of Shakespearian quippery. Stroustrup has inserted the word ‘language’. But who speaks these words in Henry VI, and what does Shakespeare mean?

These words are spoken by Dick the butcher in response to a call to rebellion against Henry by John Cade. There are multiple meanings here, but it seems that Dick is suggesting that any rule of law be overturned. This meaning is suggested online:

Dick is a villainous character — he is a large, threatening murderer, and he is also the right-hand-man of Jack Cade, who is leading a rebellion against King Henry. Cade and Dick are aggressively anti-intellectual; they kill anyone who can read and burn all the books and documents they encounter. They know that they’ll be able to take over an ignorant population with greater ease than one where everyone understands their rights.

https://lithub.com/what-did-shakespeare-mean-when-he-wrote-lets-kill-all-the-lawyers/

https://nosweatshakespeare.com/quotes/famous/lets-kill-all-the-lawyers/

https://shakespearenerd.home.blog/2019/09/07/misunderstood-shakespeare-lets-kill-all-the-lawyers/

C and C++ have certainly managed to burn many programming fundamentals and principles. C and C++ have appealed to anti-intellectualism and anti-academia in programming. C and C++ programmers (and those in other languages) love to claim they are ‘real-world’ programmers. This is just a piece of pretentious nonsense. C and C++ have kept people in the primitive thinking of coding languages and this population is easier to control. Computing was invented in the halls of academia, not at Bell Labs.

No Conclusion

The points made against C++ may seem legalistic (from a language lawyer) and pedantic. However, this is no mere intellectual and academic exercise, defending the elite, it is about making programming better, so that as many programmers of all skill levels can be accommodated. It is those in C and C++ holding on to arcane and cryptic coding who are the elites. Criticising C++ is against those programming elites who defend cryptic and arcane languages. In 1997, Stroustrup and C++ had already been the target of much criticism by me and others. Interpreting Shakespeare the way Stroustrup might like is that those who criticise C++ should be silenced, equating the (language) lawyers with the academics and intellectuals the C culture seems to despise. C++ has been very successful in undermining progress in programming.

Much has changed in C++ since the first edition of ‘The C++ Programming Language’ was published in 1986. However, much of the same was printed in the third edition of 1997, so nothing much had changed in the core philosophy which today’s C++ is ultimately based on. What I avoided was anything that would change. The book is very revealing about the thinking behind C++, the core and foundations of the language. Like its C base, the core thinking and foundations have not been rectified with the introduction of more and more. Much of the change that has been needed in C++ has been due to the weak foundations and misguided, short-term philosophies that were never meant for modern abstract programming, particularly being backward compatible with the mistakes of C and then C++ itself.

C++ has indeed been mired in the quagmire of old features that should have been removed. Stroustrup proves this in ‘Design and Evolution of C++’ where he says about changing or removing things: “In some cases, I tried, but I backed out my changes after receiving complaints from outraged users.” Again, my claim is this is no way to design a language. Trying to keep everyone happy is counterproductive. Programmers need help moving forward, even if they don’t understand the longer-term benefits. Just giving in to them is language design by populism. But then the language has become popular — for the wrong reasons. Popularity hits a wall after a while when people realise they have been sold out for short-term popularity over long-term issues that should have been addressed long ago. Eventually it all topples down.

Stroustrup himself reminds us of a story of failure due to overburden, that of the Vasa ship:

https://stroustrup.com/P0977-remember-the-vasa.pdf

https://en.wikipedia.org/wiki/Vasa_(ship)

C++ is well beyond the sinkable Vasa. Stroustrup also makes an observation about the many different facilities that he was unable to remove in C++. C++ is a language with a weak core and foundation on which so much top heavy stuff has been placed. C was never a suitable foundation for modern programming, nor OO with classes and much else. C was an expedience to do Unix, not a language design for others. C’s appeal in the first place was the old primitive brute-force programming the old programmers were used to. It is a case of not asking users what they want — that is probably not what they need. They really don’t know and will have some brainstorming session after which all will need to be placated.

“Within C++, there is a much smaller and cleaner language struggling to get out.”

C++ is the victim of its own black hole. It can’t get out. Stroustrup set up C++’s own straightjacket, one that every other programmer must also be imprisoned by. The foundations and principles of modern programming should be expressed cleanly in programming languages. C++ is not such a language.

There are more comments I can make on an interview in ‘Masterminds of Programming: Conversations with the Creators of Major Programming Languages’. These reflect the same bad foundations in retrospect from 2009 with more of the justifications and excuses. I will save that for another article.

I can’t help thinking that “Within this article, there is a much smaller and cleaner article struggling to get out”, but we are talking about C++.

Part 9

--

--