4 ms·
Wow. I used to love C++. It was my favorite language. I still think fondly of it. But it's come time to face facts: C++ is like that super-smart friend you kn
by DanielBMarkham 11y ago
Wow.
I used to love C++. It was my favorite language. I still think fondly of it.
But it's come time to face facts: C++ is like that super-smart friend you knew in school, the one who was supposed to become the rocket scientist? Instead he's selling tickets to human-animal sex shows in third-world ghettos. Every time you look over there you're like "What happened?"
I feel like Obi Wan looking at Anakin "You were the chosen one! You were to bring balance to the force, not leave it in darkness!"
I'm left wondering: what happens now? Do standards committees just keep meeting and sticking more and more trinkets on the old horse because that's what standards committees are supposed to do? There's a ton of C++ code out there, and C++ was its own super-deep-dive specialty 20 years ago. Now it's a monster. Is it possible that it ever dies? And if not, do C++ experts become some kind of uber wizard in the tech community (moreso than they are now)?
It seems like something's gotta give somewhere, and beats me how that's going to play out.
- vmorgulis 11y agoThe language is getting better with variadic templates, range-based loops, auto keyword...
- catnaroek 11y agoIt's certainly getting more expressive. “Better” is subjective, though - IMO, there ought to be more convenient ways to achieve everything C++ can do.
- vmorgulis 11y ago> IMO, there ought to be more convenient ways to achieve everything C++ can do. Yes, it's my opinion too. C++ remains the fastest language mainly because of the compilers. That's why I still use it. Rust is a challenger. My knowledge of it is very limited but I'm not sure if its improvements will be enough to replace C++.
- catnaroek 11y agoRust is already better than C++ for those use cases that normal, idiomatic C++ serves [RAII, templates only used for (bounded) parametric polymorphism]. However, for metaprogramming, C++ still has an edge over Rust: C++ templates are more powerful than Rust macros, and more convenient to write thant Rust compiler plugins.
- munchbunny 11y agoC++ is one of those "does everything" languages. You can do everything from high level, garbage collected code, down to inlining assembly. The level of explicit control and setting up your own abstractions is really powerful. It comes with very high shoot-yourself-in-the-foot potential, but most people don't accurately assess that cost. I'm sure other languages or combinations of languages will be able to supplant C++ eventually, but the combination of inertia and some of C++'s niche capabilities, plus its extensively optimized compiler support, makes C++ just a generally hard language to replace.
- deleted 11y ago[deleted]
- cousin_it 11y agoAnd soon we will find out what magical things happen when you combine these new features with old ones in unexpected ways.
- petke 11y agoMost all languages have warts. They just look clean and simple when you dont look to closely. This wart though is never seen by users and very rarely by library writers. so it doesn't matter much.
- fish2000 11y agoI am really into C++ but it has the same problem that Perl has – it does not try to stop anyone from using it to express themselves in an ugly or inscrutable fashion – and this is a frustrating aspect of dealing with the C++ ecosystem/community. Personally I spent enough time writing Python to acquire significant coding OCD about things like whitespace, file/directory layout, documentation. When I write C++ I have two prime directives: 1, keep it compulsively tight and legible; 2, use the idioms of C++ to sort out other peoples’ APIs (as opposed to reinventing wheels). I stick to these rules like they’re a diet, it is easy to let your mind wander and find that you’ve spent half the day writing a framework instead of solving your problem; metaphorically this is the equivalent of forgetting to go to the gym and then ordering pizza for dinner. Along these lines I give myself one premature optimization a week, like as a cheat. I find it is most productive when you are using C++ “against” something. For example I just wrote a bunch of templates that eliminate like 90% of the requisite API boilerplate the Python C API calls for – that was simultaneously satisfying in both the “I totally solved that specific problem” and “dogg check out this clever snippet I wrote” senses of ‘satisfying’. Contrastingly, the last time I created a class hierarchy it was a sprawling regrettable mess – I am more “structure-oriented”, versus “object-oriented”, but still.