5 ms·
To be truthful: the older and more experienced I get I can't help but wonder why on earth people get so stuck in C++. To me the sheer weight and complexity of
by bborud 10y ago
To be truthful: the older and more experienced I get I can't help but wonder why on earth people get so stuck in C++. To me the sheer weight and complexity of C++ appears meaningless. We know better now than we did in the 80s. Yet people spend their lives trying to fix C++.
Why?
- Klockan 10y agoBecause there are many billions of lines written in C++ out there that we still want to maintain.
- IshKebab 10y agoUntil Rust there was no real alternative. All other 'better' languages use a garbage collector which is a no-go in most of the situations where C++ is used.
- the_why_of_y 10y agoNot all - Ada, Modula-2, Object Pascal tried to compete in that space, but developers were more interested in C++ because it allowed them to just #include their existing C headers. Also, before GNAT became available around 1995, Ada vendors invoiced several limbs for a license.
- swift 10y agoObjective C probably also deserves to be on that list.
- dom0 10y agoThere were some comparable languages, but they usually made it harder to use C code.
- loup-vaillant 10y agoC++ is often used in situations where a GC would have been perfectly fine. I'll go as far as to guess that most C++ projects are like this. In my little corner of the world, C++ is one of the most overused languages.
- IshKebab 10y agoUntil relatively recently GC pauses have been a real problem. Java used to have no upper bound on stop-the-world GC pauses - your program could literally stop doing anything for an entire minute. But these days GCs are much better, and especially with the Go GC having sub-millisecond pauses I think you are right that most projects written in C++ today could be written in Go. (And it seems like that is starting to happen.)
- user5994461 10y agoThe real alternative has always been Ada.
- geezerjay 10y ago> To be truthful: the older and more experienced I get I can't help but wonder why on earth people get so stuck in C++. For a number of reasons. First, it actually works. Second, a lot of software is written in C++. Third, availability of third-party libraries and tookits. Fourth, people do know how to write software in C++, and some even have decades of experience under their belt. Fifth, it's an international standard, therefore better ensured against bit rot. Sixth, why should anyone jump onto the latest fad just because? I seriously don't understand why this myth about "newer automatically means better" is so entrenched in the minds of those just starting out in software development.
- loup-vaillant 10y agoFirst, second, and third, suggest a very strong path dependence. We keep using C++ because we used it in the past —just like Qwerty. Fourth is also a kind of path dependence, but… come on, reasonable programming languages are simple (Lua and 1ML come to mind). Libraries and frameworks take time to learn, but a core language needs a couple days to be picked up, maybe a couple weeks for full productivity. Assuming you knew the underlying paradigms in the first place of course —no Haskell programmer learns Forth in a day. Of course newer is not automatically better. See the mess we made of the web. Still, it is safe to say that nobody in their right mind would invent C++ today. As Rust is showing, we can do better. Even so, I'm extremely wary of this "one language to rule them all". Why does the "right tool for the job" always end up being the vanilla version of some popular language? Where are the languages specialists that can tweak your language into something uniquely suited for your particular needs? Seriously. We call in database specialists, network specialists, security specialists, OS specialists whenever the project has significant demands in those domains. Why are programming languages left out? We breathe with that stuff!
- bborud 10y agoDoes anyone really believe that "one language to rule them all" is a feasible goal?
- 10y ago
- overgard 10y agoWhat else would you use? C is comparatively painful (no useful standard library), Rust is unproven, and the various Lisps never got any traction.