14 ms·
Bjarne Stroustrup Quotes
- deleted 3y ago[deleted]
- jll29 3y ago"We didn't have time for that." (Bjarne Stroustrup, before an invited talk, Cambridge Computer Lab) (in response to my complaint to him that hastables again hadn't been included in the most recent standard at the time.)
- B1FF_PSUVM 3y agoYeah, so many programmers had to find the time to implement them or find an STL library with the stuff. The really important stuff was printing with "<<", or whatever ...
- zabzonk 3y agoC++ is my favourite programming language precisely because one of its main designers is so sensible.
- IshKebab 3y agoYeah mine too until Rust. But part of that sensibleness was making it backwards compatible with C, which entails a mountain of inherited design mistakes. I wonder what his blank slate language would have looked like.
- koolba 3y agoC++ is not backwards compatible with C. It’s mostly compatible, but it’s not completely compatible like say Objective C which is a strict superset of C.
- PH95VuimJjqBqy 3y agohonestly, no one cares about splitting that hair. Most valid C programs will compile in C++ and believe it or not, binary logic is not the only logic humans are capable of.
- zabzonk 3y agoactually, i reckon that most, if any, c programs will not compile with c++, without at least some (possibly not difficult) modifications
- latency-guy2 3y agoMy only qualms is the number of genuine C only compilers in use, vs number of embedded system companies/projects/codebases in the world. The subset of C features that are incompatible with C++ is quite small, and most of the features are a little out of the way IMO. Of the regular suspects (GCC, MSVC, Clang), your C codebase is probably entirely compatible with C++ as each of these has varying levels of compliance with the C and C++ standard.
- PH95VuimJjqBqy 3y ago> Of the regular suspects (GCC, MSVC, Clang), your C codebase is probably entirely compatible with C++ as each of these has varying levels of compliance with the C and C++ standard. yep, leave it up to the technical crowd to try and split hairs too fine.
- tsimionescu 3y agoAlmost every C program does `int *c = malloc(sizeof(int) *10)` or similar, which has always been invalid C++.
- fluoridation 3y agoI believe most compilers have switches to allow this. The real issue you might run into that can't be worked around easily is if the C source uses a C++ keyword as an identifier.
- pjmlp 3y agoUntil C++98 came to be, nowadays, regardless of how sensible Bjarne Stroustoup happens to be, his opinion is a vote among 300 or so. Remember the Vasa paper happened for a reason.
- zabzonk 3y agoof course, but he is still very influential. better than languages that have no standard at all.
- Dudester230602 3y agoLet's also not forget this: https://harmful.cat-v.org/software/c++/I_did_it_for_you_all https://harmful.cat-v.org/software/c++/I_did_it_for_you_all
- Borg3 3y agoHaha.. Classic :D I remember reading it back in the days...
- jacquesm 3y agoThat's a very nice find. I love that kind of candor about motivations on why software is written the way it is written. ;) I probably have a few confessions to make myself... But the royalties are just too good.
- emmelaich 3y agoI don't find it at all insightful or humorous. (I hope you don't think it's genuine)
- jacquesm 3y ago> I don't find it at all insightful or humorous. Humor isn't an absolute. I find it funny because if Stroustrup had tried he probably couldn't have made a language with more footguns, there are so many things in there that require a lot of discipline not to use (or overuse). At the same time it was a supremely useful language that allowed for much better abstraction than C ever did but it definitely came with a price. > (I hope you don't think it's genuine) Wait, what, that wasn't real???
- chubot 3y agoLanguage design is a curious mixture of grand ideas and fiddly details I hadn't heard this last one before, but it's SO right ... I always wondered why JS and PHP and Perl got so many details "wrong" (e.g. with Perl, one definition of "wrong" is that Perl 6 / Raku didn't make the same design choice) Turns out there's an avalanche of details, and they interact in many ways! Python did better, but I strongly argue both Python 3 and Python 2 got strings wrong. (Array of code points isn't generally useful, and it's hard to implement efficiently. See fish shell discussion about wchar_t on the front page now; also see Guile Scheme) OCaml seems to have gotten mutable strings wrong (for some time), and also I think the split between regular sum types and GADTs is awkward. And also most people argue that objects vs. records vs. modules is suboptimal. And a bunch of mistakes with syntactic consistency, apparently. Looks like almost every language had problems with for loops and closures, including C# and Go - https://news.ycombinator.com/item?id=37575204 https://news.ycombinator.com/item?id=37575204 So basically I agree that plowing through all the details -- and really observing their consequences in real programs -- is more important and time-consuming than grand ideas. But if you lack any grand ideas, then the language will probably turn out poorly too. And you probably won't have any reason to finish it.
- gautamcgoel 3y agoCan you explain how you think strings should work?
- deleted 3y ago[deleted]
- klodolph 3y agoI think the main alternative design is to treat strings like in Rust or Go. The problem with the “array of code points” idea is that you end up with the most general implementation, which is a UTF-32 string, and then you end up with the fastest implementation, which is a UTF-8 string, and maybe throw in UCS-2 for good measure. These all have the same asymptotic performance characteristics, but allow ASCII strings (which are extremely common) to be stored with less memory. The cost is that now you have two or three different string representations floating around. This approach is used by Python and Java, for example. The Rust / Go approach is to assume that you don’t need O(1) access to the Nth code point in a string, which is probably reasonable, since that’s rarely necessary or even useful. You get a lot of complexity savings from only using one encoding, and the main tradeoff is that certain languages take 50% more space in memory. Python and Java both date back to an era where fixed-width string encodings were the norm.
- deleted 3y ago[deleted]
- getpost 3y agoI'll see you Bjarne Stroustrup, and raise you Alan Kay, "Actually I made up the term "object-oriented", and I can tell you I did not have C++ in mind." https://en.wikiquote.org/wiki/Alan_Kay https://en.wikiquote.org/wiki/Alan_Kay
- fosforsvenne 3y agoBjarne didn't have Alan in mind when designing C++ either.
- sgift 3y agoIf he had, we would all be better off.
- AnimalMuppet 3y agoThat's why so much more real-world software was written in Smalltalk than in C++. Wait...
- fluoridation 3y agoIt's almost as if language and meaning evolve in the minds of people in strange ways.
- paulddraper 3y agoFun fact: The Wright brothers didn't have modern airliners in mind when they invented airplanes.
- aryehof 3y agoMade up the term, but didn't invent object orientation. The real inventors were more generous.
- igouy 3y agoA selective quotation which misses the point. "Actually I made up the term "object-oriented", and I can tell you I did not have C++ in mind. The important thing here is that I have many of the same feelings about Smalltalk."
- fuzztester 3y agoShooting yourself in the foot in various programming languages. http://www.toodarkpark.org/computers/humor/shoot-self-in-foot.html http://www.toodarkpark.org/computers/humor/shoot-self-in-foo...
- kmstout 3y agoMy favorite: UNIX: % ls foot.c foot.h foot.o toe.c toe.o % rm * .o rm: .o: No such file or directory % ls %
- fuzztester 3y agoHa ha. And that's not even a newb mistake alone. It's possible even for an expert to maje, by just one accidental space keypress, between the * and the .o, in 2nd command above. Such is Unix.
- euroderf 3y ago"rm -I" provides some protection.
- lmedinas 3y ago"There are only two kinds of languages: the ones people complain about and the ones nobody uses". He is right on this one. Pretty much in every discussion about Programming Languages people write how good Rust is and complain about how bad C++ is but the reality is, C++ it's one of the most used languages in the world. This quote could be a very harsh reply to Rust vs C++.
- sgift 3y agoNo, it could be a very stupid reply to Rust vs C++ since people do write in Rust. Bigger programs get written in it all the time and - what a surprise - people who use it have things they are annoyed about, which is why it gets improved. To me this is one of the most stupid things he's ever uttered on one hand and the most useful one on the other. Cause it can be used to remind people that there's always trade-offs, which is a good thing if a discussion gets a bit too heated and "I am right!" "No, I am right!", but it can also be used, and most often is, as a very shallow and arrogant dismissal - funny enough, especially by C++ zealots, IME - of someone trying to fix some things. As if trying to do things better is somehow an affront to their greatness.
- einpoklum 3y agoFWIW, I think Bjarne and other C++ magnates have a plan for eating Rust's lunch by allowing for "safe"/"unsafe" within C++.
- sgift 3y agoSounds like something they could try. We'll see what happens. It's not like I expect C++ to "roll over" and just declare that they don't care anymore if people use the language.
- dralley 3y agoI'm skeptical of the value of adding on "safe / unsafe" to C++ at this point. It's a bit like adding type annotations to Python. Better than nothing I suppose, but there's 30+ years of C/C++ that doesn't and will never be opted-in to these features, and the value declines rapidly when only 10% of the codebase (including dependencies) can be considered "safe" vs. when 99.9% of it can be. https://cor3ntin.github.io/posts/safety/ https://cor3ntin.github.io/posts/safety/
- jlarocco 3y agoSection 10.7 of "The Design and Evolution of C++" has some good ones from the early 90s: "When (not if) garbage collection becomes available, we will have two ways of writing C++ programs." "I suspect that a garbage collection scheme can be concocted that will work with (almost) every legal C++ program, but work even better when no unsafe operations are used." "I am under no illusion that building an acceptable garbage collection mechanism for C++ will be easy - I just don't think it is impossible. Consequently, given the number of people looking at the problem several solutions will soon emerge."
- fluoridation 3y agoWell, we now have garbage collection. Just not tracing garbage collection.
- pjmlp 3y agoTracing GC is there on C++/CLI, Unreal C++, Bohem and V8's Olipan.
- fluoridation 3y agoBut not on standard C++. And C++/CLI doesn't collect garbage of native objects.
- pjmlp 3y agoDepends on how C++/CLI was compiled, and how was that allocation done. TIMTOWTDI The biggest issue with current ISO C++ is that the standard desigs some features on paper, instead of adopting existing extensions as standard features, as it used to be. Hence when paper designed features get wrongly designed, no one picks them up.
- einpoklum 3y agoActually, these quotes have become outdated by the language itself! ... in favor of this quote: > I don't like garbage. I don't like littering. My ideal is to eliminate the need for a garbage collector by not producing any garbage. That is now possible. See this question: https://stackoverflow.com/q/147130/1593077 https://stackoverflow.com/q/147130/1593077 and this answer (of mine): https://stackoverflow.com/a/48046118/1593077 https://stackoverflow.com/a/48046118/1593077
- shrubble 3y ago"The official mascot for C++ is an obese, diseased rat named Keith, whose hind leg is missing because it was blown off. The above image is a contemporary version drawn by Richard Stallman." I have been unable to determine the provenance of this quote. Source and image: https://ifunny.co/picture/history-the-official-mascot-for-c-is-an-obese-diseased-Yy6zDtEU9 https://ifunny.co/picture/history-the-official-mascot-for-c-...
- AYoung010 3y agoThe first place I ever saw that was here: https://en.uncyclopedia.co/wiki/C%2B%2B https://en.uncyclopedia.co/wiki/C%2B%2B Whole article is worth reading, lots of good laughs in there!
- CSMastermind 3y agoProgramming -- Principles and Practice Using C++ is one of the few must-read programming books in my opinion. Even if you're a C++ expert, have 20 years in industry, etc. it's still an amazing example of beautiful technical writing.
- bobmaxup 3y agobjarne stroustrup, underrated hero of many facets of society, imo
- mike_hock 3y ago> "When (not if) automatic garbage collection becomes part of C++, it will be optional" Technically, his prediction (the implied inevitability of GC) came true, in practice, it did not. Optional GC was added, never implemented, never used, and removed again.
- pjmlp 3y agoMostly because its design never took into consideration the needs of Unreal C++, C++/CLI, C++/CX, Bohem and Olipan. So the major C++ GC implementations ignored what was there and kept using their own solutions.
- actinium226 3y ago> "Java is to JavaScript as ham is to hamster". No. Never. Nothing even close to that. I try hard not to be rude about other languages. To be fair, it's not exactly a rude statement.
- zubairq 3y agoSo many brilliant quotes here, thanks for posting
- default-kramer 3y agoI don't remember the exact quote, but I saw a talk where he said something like "People want big/verbose/explicit syntax for the languages features they don't understand, and small/terse/implicit syntax for the language features do understand." It made me realize that many of my language design opinions at that time were a matter of personal preference.
- physicles 3y agoAgree. This is also true of UX design in general.
- chubot 3y agoYou might be referring to this, which I think is even more accurate. Dave Herman quotes him: https://www.thefeedbackloop.xyz/stroustrups-rule-and-layering-over-time/ https://www.thefeedbackloop.xyz/stroustrups-rule-and-layerin... One of my favorite insights about syntax design appeared in a retrospective on C++ by Bjarne Stroustrup: For new features, people insist on LOUD explicit syntax. For established features, people want terse notation. I call this Stroustrup's Rule. Part of what I love about his observation is that it acknowledges that design takes place over time, and that the audience it addresses evolves. Software is for people and people grow. Side note: Dave Herman is Rust's most unrecognized contributor: https://brson.github.io/2021/05/02/rusts-most-unrecognized-contributor https://brson.github.io/2021/05/02/rusts-most-unrecognized-c... I often notice that the actual Rust authors and designers respect and are influenced by C++ very much. (Niko M is another C++ fan) It's only the randoms online that like to start C++ vs. Rust arguments. Another thing to note is that the Mozilla Rust is MUCH closer to C++ than Graydon's Rust was. Graydon's Rust was not at all about zero-cost abstraction, the shared motto of C++ and Rust.
- smarks 3y ago“C++ is a language, not a religion.” I swear Stroustrup said this at the beginning of his EE380 (CS Colloquium) talk at Stanford around 1986. At the time we (grad students) were all C programmers and we were sure that C was the best language evar, at least, better than Pascal, which was the language Stanford used for teaching back then. So we all wanted to see this person who had the temerity to claim that he had improved C and who had the audacity to call it “C++” of all things! Skilling Auditorium was packed. When Stroustrup took the stage, a tense hush fell over the crowd. He said the above line fairly quietly, and everyone burst out laughing, breaking the tension. The rest of the talk was a pretty straightforward explanation of C++ 1.0, and I came away fairly impressed. Several years later at another talk I asked him to inscribe my copy of the C++ book with that quote. He claimed not to remember it, but he inscribed the book per my request anyway. I think the quote holds up well.
- jesse__ 3y agoI disagree so, so strongly with this. C++ programmers are one of the most religious groups around, eclipsed only recently by the rust community. Try telling a C++ programmer RAII is not a good idea. I dare you. Or smart-pointers. Or that the STL is mostly-garbage.. Trying to honestly have these conversations is typically an exercise in starting a religious flame-war.
- rcxdude 3y ago"Man annoyed no fish wants to have a debate about his position that being wet is evil. Convinced this makes him right by default"
- boris 3y agoI am a C++ programmer and if you told me those things, I would just flip a bozo bit on you and carry on coding, no religious flame-war is warranted.
- jesse__ 3y agoPoint proven
- devjab 3y ago“The problem with many professors is that their previous occupation was student” This one is one of the more impactful on our industry in my opinion. I have a “side gig” as an external examiner, which means that every half year I get to sit through examinations on topics that I know most of the students will never ever have to use. And that’s the best case for much of it, the worst case is all the stuff they’re going to need to unlearn to actually become good programmers in a world where much of the academic programming that is taught today is the same I learned more than 20 years ago. Like a heavy use on technology based architecture, like separating your controllers and your models into two directories… Fine when you have two or three, not so fine when you have 9 million. I’m still impressed with how hard it’s been for domain driven architecture and a focus on actual business logic to make its way into academia when it’s literally always going to be how the students are expected to work in my area of the world. The same goes for much of the OOP principles, like code-share which has been considered an anti-pattern around here for the better part of a decade. Not because the theory is wrong, but because it just never works out well over a period of several years and multiple developers extending and changing the shared code. I’m honestly not sure how we can change it though. Because most of the people who govern the processes are exactly students who’ve become professors, and if I had gone that route myself, I’d probably also be teaching the flawed lessons I was taught those 20+ years ago. Hell, I would’ve still taught them a few years into my career as it wasn’t until I “stuck around” or got to work on long running projects it became apparent just how wrong those theories were in practice. Again, not because the theories are wrong but because they are never applied as intended because the world is so much less perfect than what is required for the theories to actually work. You’re not going to be at your best on a Thursday afternoon after a sleepless week of baby watching and being slightly sick, but you’re still going to write code and someone is going to approve it.
- psychoslave 3y ago>And that’s the best case for much of it, the worst case is all the stuff they’re going to need to unlearn to actually become good programmers in a world where much of the academic programming that is taught today is the same I learned more than 20 years ago. Not commenting on the general picture of "student to professor without any industrial experience in the middle", just this point. At some point, you have to acquire the basics. Learning to articulate thoughts into algorithms is something to be acquired at some point to work in CS, and this just didn’t change over the last 20 years. That’s the whole point of Knuth’s (M)MIX actually. Just like learning to use alphabet won’t be enough to write every prose you will ever need, but alphabets don’t change every six months.
- rob74 3y ago> "People who think they know everything really annoy those of us who know we don't" I have read some of these quotes before, but not this one. Very true, especially for designing programming languages (where many people think they're experts), but not only...
- closetkantian 3y ago"Nobody should call themselves a professional if they only know one language". Presumably he means programming language, but this may apply more generally.
- hardware2win 3y agoThats very bad take. Concepts are above languages.
- wizerdrobe 3y agoI would respectively beg to differ. Getting your hands dirty actively engaged in the practice of building software in multiple languages is needed to get good, diverse sets of experience around what works and why. Reading books or worse, opinions on HN, just isn’t sufficient to claim a robust and well-rounded resume.
- hardware2win 3y agoNowadays languages are huge enough to cover various paradigms and countless concepts That should enough, right?
- rramadass 3y agoA few of my favourites; > An organization that treats its programmers as morons will soon have programmers that are willing and able to act like morons only. In a broader sense what it implies is that companies should not make a Programmer's job onerous (in any dimension) to the point that the "joy" is gone from the doing of the activity itself. Thus Reports/Meetings/Processes/Testing/etc. should all be modulated/balanced based on needs/project and not because it is the latest fad. Managers should really really heed this. > Far too often, 'software engineering' is neither engineering nor about software This is a follow-on from the above. > Any problem in computer science can be solved with another layer of indirection. I have also heard this attributed to Andy Koenig. > My ideal of program design is to represent the concepts of the application domain directly in code. That way, if you understand the application domain, you understand the code and vice versa. This is how i learnt the techniques of designing in C++ from the early days i.e. from "Barton and Nackman's Scientific and Engineering C++" and "James Coplien's Multi-paradigm design for C++". This is fundamental to problem-solving itself and hence in any job it is of utmost importance to understand the domain i.e. Why and What is being done rather than the How. > Legacy code' often differs from its suggested alternative by actually working and scaling. Very very true. This is why i dismiss people who come in and start saying "everything must be rewritten" without spending time studying and learning about the existing system.
- amadeuspagel 3y ago> "There are only two kinds of languages: the ones people complain about and the ones nobody uses". Yes. Again, I very much doubt that the sentiment is original. Of course, all "there are only two" quotes have to be taken with a grain of salt. True for many things. There are only two kinds of companies: the ones people complain about and the ones with no market power.
- uwagar 3y agokinda reminds me of a page on stallman.org that tells potential hosts what stallman likes and dont likes...if only i could find that link....hmmm..