Abominable Function Types (C++)
open-std.org
open-std.org
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.
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++.
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.
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.
#include "ostream"
namespace std {
basic_ostream cout;
ios_base::Init x0;
}
int main() { std::cout << "Hello"; }
The ostream content is very interesting:http://blog.regehr.org/archives/1278
Wren is a cool language :-)
> This paper tries to shed some light in the dark corners, and explores whether the language can be cleaned up so that good template documentation does not drag obscure language-lawyer details into the domain of the regular user.
For regular people it's a non-concern. I'd be happy to be corrected if I misinterpreted something :)
In any case, that's what the "in the wild" constraint is for. The name length limits imposed by the ecosystem probably aren't as interesting as the creatures you can find swimming in its depths. Probably.
To be fair, the author does mention this is not for civilians ...
http://www.softwarepreservation.org/projects/c_plus_plus/cfr...
I'm barely up to speed with C++11 and recognize the && move syntax but I've never seen "using" and don't understand the author's intent.
With "using", you can define an empty/illegal/abominable function looking like a pointer to function (usually done with a "typedef").