5 ms·
You are an interesting person to have this discussion with, because you clearly have wide and deep exposure to programming languages. And although plenty of com
by patrec 6y ago
You are an interesting person to have this discussion with, because you clearly have wide and deep exposure to programming languages. And although plenty of computing luminaries are not shy about their distaste for C++, you are in the good company of the likes of David Ungar, who also seems to esteem both Stroustrup and C++.
> I think Bjarne Stroustrup is a very good language designer, his problem is that his vision is not understood by those teaching C++ [...]
I really do no think that that this excuse cuts it; in my opinion to qualify as a very good language designer, you should either 1. really be able to lay claim to some interesting innovation (Iverson, McCarthy, Kay and Moore clearly qualify) or at least 2. have good design sense and avoid severe unforced errors (I'd put van Rossum in this category, but others will disagree). This goes doubly if you decide, as Stroustrup did, to start off with a programming language already full of gratuitious and fiendish footguns -- you should probably be extra careful in that case. Do you agree? I think it's very hard to argue that C++ doesn't add plenty of major additional, unnecessary footguns on top of those it already inherited from C, and it's not completely clear to me what major innovation C++ pioneered. I think there was real marketing genius in laying claim to being the zero-cost/pay-as-you abstraction language, and even C++ haters such as the Go authors seem to like concepts enough to basically adopt them for Go but what would you say the major breakthroughs C++ brought were?
- pjmlp 6y agoFor starters, C++ is the language that made RAII concept mainstream. It was also the language that brought exceptions and generics pioneered by CLU and ML into mainstream computing of 90's 16 bit computers. Stepanov ideas for generic programming initially prototyped in Ada83, grew to his vision in C++, thus bringing this ideas to a wider public, back when SGI became the keeper of the initial STL documentation. Bjarne Stroustrup gave control of C++ in 1990 and became just one person vote, whatever happened afterwards was no longer under his control. If you want his vision for the language before that event took place, you can refer to C++ARM and The Design and Evolution of C++ books. He is the very first to call the attention of WG21 to the wrong direction of too many footguns with "Remember the Vasa" paper, but again, one person vote.
- patrec 6y agoI never understood why C++ programmers like to make a big deal out of RAII (one of these purple acronyms only the C++ community can come up with). Object lifetime tied resource management seems like an utterly obvious idea, I mean how else would you do it? There is a natural synergy with deterministic destruction (via stack allocation or reference counting) and resource life time management and I suspect the only reason C++ gets credit is that it has long been the only popular language with both objects and stack allocation¹. But lisps have had exactly the same concept via with-* macros (which explicitly introduce a scoped resource and perform cleanup on normal or exceptional exit) for ages, and I assume this precedes C++ by quite a bit. Also, RAII in C++ is subtly broken: C++ programmers like to use it to relinquish system resources (such as file handles) where relinquishment can fail and C++ really has no way to deal with that. > Bjarne Stroustrup gave control of C++ in 1990 and became just one person vote, whatever happened afterwards was no longer under his control. Well, it's not like "C++90" was this beautiful and elegant language (MVP, fun interactions between overloading and C's implicit integer conversion rules etc) corrupted by later design by committee. Also, he pretty strongly endorsed at least C++11 ("Surprisingly, C++11 feels like a new language: The pieces just fit together better than they used to and I find a higher-level style of programming more natural than before and as efficient as ever."). > If you want his vision for the language before that event took place, you can refer to C++ARM and The Design and Evolution of C++ books. Any chapters/page-ranges in either (or elsewhere) that you specifically recommend? I've read a bunch of Stroustrups writings or interviews over the years, but I don't remember anything that struck me as particularly insightful or interesting. > He is the very first to call the attention of WG21 to the wrong direction of too many footguns with "Remember the Vasa" paper, True, and he also said that Boost whilst being high quality and you should totally use it sometimes goes a bit overboard in terms of complexity (no kidding), but given the footguns and convolutedness he is personally responsible for, it rings a bit hollow to me. Concerning STL: that seems mostly Stepanov's baby (as you noted) and I'm not fully convinced on its merits; there are good things about it -- it is generic, it tries to separate algorithms from concrete data structures, and to make it possible to efficiently operate on a subset of a data structure. Lastly it made complexity bounds part of the API, which I believe may have been an innovation. But it's also quite cumbersome and error prone to use. ¹ Some older GC'ed languages expose stack allocation as an opt-in optimization (e.g. some lisps), but not as a true first class concept.