Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

He basically added every feature he could think of on top of C, glued it with spit and released it as a pre-processor. There was barely any design involved. Just look at how many types of inheritance there are.

I remember Stanley B. Lippman (one of the first developers on cfront) recollecting how the proposal to implement multiple inheritance was met with resistance from the community. And the implementing team realized they couldn't write a sane implementation, and people complained against it, but they made one anyway, partially because they wanted to prove they could. New features to cfront were added with very little concern for design.

Things where standardization would have mattered (like the mangling algorithm) were never touched, so now every compiler has the liberty to generate whatever symbols it wants, and call functions with whatever calling convention it chooses, so you either have to compile all your dependencies, or make sure you fetch the binaries that use the exact same compiler version and flags, otherwise they won't link.

Also, Stroustrup didn't "soldier on", the CPP standard is maintained by a committee of people from all over the world, and the standard library slowly adopts data types and algorithms from the boost library, because they need a multi-year staging period, handled by someone else, to see if things work before they muster the courage to standardize it.



The reasoning behind what was added is clearly described in the "Design and Evolution of C++" book.

Besides the main reason why C++ exists is because he swore to himself never to go through the Simula => BCPL downgrade ever again, and C is a tiny step up from Bootstraping CPL compiler, so....


Here are a few excerpts from "The Design and Evolution of C++"

        Another factor was purely irrational. Nobody seemed to doubt that I could implement templates efficiently. Multiple inheritance, on the other hand, was widely supposed to be very difficult to implement efficiently. For example, in summary of C++ in his book on Objective C, Brad Cox actually claimed  that adding multiple inheritance to C++ was impossible. Thus, multiple inheritance seemed more of a challenge.
He then goes on a 13 page explanation of how he thought there was a simple implementation.

He then acknowledges the controversy, but brushes it aside with:

        I think - as I did then - that the fundamental flaw in these arguments is that they take multiple inheritance far too seriously. Multiple inheritance doesn't solve all your problems, but it doesn't need to because it's quite cheap. Sometimes multiple inheritance is very convenient to have.

        I have kept out of the multiple inheritance debates: multiple inheritance is in C++ and cannot be taken out or radically changed; I personally find multiple inheritance useful at times; some people insist that multiple inheritance is essential to their approach to design and implementation; it is still to early to have solid data and experience about the value of C++ multiple inheritance in large scale use; and, finally, I don't like to spend my time on sterile discussions.
This goes hand in hand with the original "principles" of C++ design, namely "C++ must be useful now". It didn't really matter how the complexity will evolve in the future, as long as it solved someone's problem today. And once it was implemented, there was no going back, so it didn't matter what people thought, it was done.

This process isn't really what I would call "design".


So what would you call "design", the ups and downs of C married with UNIX porting from PDP-7 into PDP-11, or a waterfall design Algol-68 style?


Rob Pike's reluctance to implement anything in Go that would add unnecessary complexity. Or Andrew Kelley's Zig language principles of no hidden control flow.

These are examples of doing more with less and avoiding unnecessary complexity by thinking ahead. Ironically, they probably wouldn't be designed the way they are if it wasn't for the hindsight provided by C++


Ah that is why Go has such a great design for generics, and Zig already has the ideal solution for use-after-free errors, got it.


People still write Go applications fine without generics, and Zig is a smidge higher level than C and currently in beta. How does this disprove anything I argued before?


Ah, so now the argument moved from how delightful the authors of those languages are capable to perfectly design them, to people write code in them, got it.


It's really ironic that you're the one to play the goal post moving card, when you haven't refuted my original statement.

They don't have to be "perfectly" designed, the design needs to exist. If Go didn't have a design, it would've had a half assed generics implementation, like C++ has multiple inheritance. It's precisely because generics are hard to implement right and the design constrains how much you can stretch the language that Go still doesn't have them. And it's arguably a good thing.

Sorry I wasn't explicit: it's safer and easier to write the same application in Go or Zig than it is in C++, even without generics or read-after-write compile-time checks.


No my dear friend, you attack Bjarne Stroustrup, asserting he doesn't have a clue how to design a language, and then present two examples of design perfection, which have proven to actually be just as clunky.

Go generics are half assed, compromised to fit into existing codebases, as it was expected they would turn out.

Are you also going to argue for the beautiful design of nullable interfaces that aren't actually null?

Maybe it was the clever design idea that one has to produce a compiler error to validate if a given type does support or not a specific interface.

I know, modules, what a beautiful design, where the community feedback was greatly appreciated, what a lovely design it turned out to be.


I didn't assert Bjarne doesn't have a clue how to design a language (and I can list features of C++ that are brilliant). I didn't provide examples of "design perfection", I provided examples of design principles I think better manage complexity.

I asserted CFront was a mess of ad-hoc features implemented in a rush prioritized by personal hubris. I asserted Bjarne didn't consider how much complexity was piling up and didn't listen to critics. I've provided you with quotes from his own book supporting this.

Your every reply was condescending whataboutism, my friend. Can you provide counter arguments why CFront was a beautifully thoughtfully designed language where features and complexity was considered and debated before being implemented? Because all your other arguments are just strawmen.

And I would really appreciate it if you could use a language that at least tries to use a constructive tone that adds value to the debate, instead of the snarky sarcasm one-liners. I don't care much for this white horse, Bjarne defending attitude.


I suppose you have reviewed the source code of Go and Zig compilers with the same attention to design quality then.


I've actually watched Andrew Kelley stream implementing and designing the Zig compiler and I've been following the discussions on language features. But this is just another whataboutist strawman.


Or, how much ways is there to initialize a variable: https://mikelui.io/2019/01/03/seriously-bonkers.html




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: