I heard from a friend that Bjarne Stroustroup admitted that he doesn’t know entirely the C++ programming language due to its vast complexity
Is it true and there’s some referrable sources or is it just an exaggeration?
This affirmation should be present on his website, he told it in an interview/conference some time ago
10
In a comment to your original question, I mentioned that I’d seen something similar, but I couldn’t find it. Well, I found what I was thinking about.
From Stroupstrup’s “interviews” page, there is a link to a PDF (“Interview by Ryou Ezoe”)
Page 9 of the PDF has the quote I’d remembered. It reads as follows (Stroustrup speaking):
Even I can’t answer every question about C++ without reference to
supporting material (e.g. my own books, online documentation, or the
standard). I’m sure that if I tried to keep all of that information in
my head, I’d become a worse programmer. What I do have is a far less
detailed – arguably higher level – model of C++ in my head.
So, if nothing else, I found what I’d been looking for. Your question forced me to do it. Thank you.
4
I don’t know if Stroustrup ever said anything like that. I’ve never heard that.
I did once attend a lecture by Brian Kernighan in 1992 or thereabouts where Kernighan pointed out humorously that he routinely wrote programs that used every feature of C and had never even come close to writing a program that used all the features of C++, but his point was not that C++ was unknowable; rather, that the language had added a lot of special-purpose features.
More generally: it is very difficult to keep all of a large, complex language in your head at once. If a language has n non-orthogonal features then there are O(n2) interactions between those features.
2
is it just an exaggeration? …this affirmation should be present on his website
It’s just an exaggeration and you are right, affirmation of that is present on his website, right in the FAQ page. Stroustrup’s position on C++ complexity is clearly stated in FAQ -> Why is C++ so BIG?
Full quote of this section is presented below for your convenience, I put bold font on the part of text that directly addresses your question (Stroustrup does not think C++ is vastly complex):
C++ isn’t as big as some people imagine. It’s not a tiny language designed to be a minimal language for teaching, but neither are the languages people most often compare it to, such as C, Java, C#. They too are huge compared to say, Pascal as Dr. Wirth originally defined it – for good reasons, I think. The programming world is far more complex today than it was 30 years ago, and modern programming languages reflect that.
The C++ standard is 740 pages, but that includes 400 pages of library description. The language features are described (in excruciating detail) in 340 pages. Similarly, TC++PL is 1000+ pages, but only 350 of those are devoted to the explanation of language facilities and their use; the rest discuss libraries, programming techniques, etc.
C++ directly supports (i.e., in the language) what some other languages support through libraries, so the language part will be relatively larger. On the other hand, if you want to write a “typical modern application”, you need to consider operating system interfaces, GUI, databases, web interfaces, etc. the sum of language features, libraries, and programming conventions and standards that you must become familiar with dwarf the programming language. Here, C++’s size can be an advantage as far as it better supports good libraries.
Finally, the days where a novice programmer can know all of a language are gone, at least for the languages in widespread industrial use. Few people know “all of C” or “all of Java” either and none of those are novices. It follows that nobody should have to apologize for the fact that novices do not know all of C++. What you must do – in any language – is to pick a subset, get working writing code, and gradually learn more of the language, its libraries, and its tools. For my suggestion on how beginners can approach C++, see Programming: Principles and Practice using C++.
The misquote your friend refers to likely originates from that very section quoted above, as a satire on the statement “the days where a novice programmer can know all of a language are gone, at least for the languages in widespread industrial use”.
Note that if you just drop the word novice from that quote, you can pretend that “can’t know all of the language” applies to Stroustrup himself.
Note though that the way it is really stated (with novice word in it), it suggests that Stroustrup believes to know all of a language and even more, he believes that with sufficient experience (sufficient to stop being novice), anyone can know.
2
Since 1998 C++ is an ISO international standard, which basically means it’s not just one person redacting it. It’s a committee with a lot of people arguing about features to add or things to change (after a proposition have been made ready for review). It also means the details of the language might not be understood fully by all committee members, mainly because C++ standard document is mainly targeted at compiler implementer.
I don’t see why it is surprising that the original author can’t know all the details.
0
Stroustrup writes “The C++ Programming Language”, which is described (by the publisher) as “his definitive reference” and “The C++ Programming Language, Fourth Edition, delivers meticulous, richly explained, and integrated coverage of the entire language” (emphasis mine).
It’s possible that the publishers are lying, but it’s also possible that Stroustrup does understand the whole language, or can research it well enough for his purposes in a given situation. I’m inclined to believe the latter.
5
It’s likely an exaggeration, in the same spirit as the fake interview with Stroustrup where he basically “admits” that C++ was designed entirely as a conspiracy to promote programmer job security.
Even if it is true, what does it really mean? What does it mean to “know entirely” a programming language? Does that mean you know every keyword? Does that mean you know every function in the standard library? I’ve been programming in Python for years now, and I certainly haven’t memorized every function in the enormous standard library.
Regardless, claims about the complexity of C++ are often exaggerated or at least, misleading. I regularly program in C++ and Python. When programming in Python I very often have to peruse the docs to find the exact function parameters or whatnot for some function in Python’s enormous standard library. In contrast, I barely ever look at any C++ docs, because I pretty much have STL syntax burned into muscle memory, since the C++ standard library is pretty small and generic compared to other languages.
Yes, C++ has many obscure corners like member function pointers, virtual inheritance, pointer-to-data-members, etc. But every language has obscure corners. (Did you know Java has a Void
reference type? Have you fully memorized how to work with memoryview
objects in Python?) In practice, these features are so rarely used that you’ll probably need to open up a reference no matter what if you decide to use them or encounter them in someone’s code. But that hardly kills overall productivity, because again, these features are rarely used.