C++: C with blackjack and 40 year old hookers. Anyway, only the rich can inherit diamonds or something. Or perhaps not, my memory is corrupted. I'm open to any pointers though...
Programmer Humor
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
The C++ feature set is a giant tome written in an unsteady hand and bound with suspicious leather. You're supposed to study it deeply, use as little as possible, and ideally have a backup plan if things go wrong for this plane of existence.
i like to think of C++ as a testing ground for new features and paradigms. to see how some concepts will handle in production.
Perfect description.
It also describes why I now love GoLang so much.
"How has GoLang improved on this unholy tome or horrors?"
"Well, it fits in my pocket now."
I like C# better. Ok, I'll see myself out.
Me too. If I can use it, I prefer C# — that is — if I’m not doing systems programming, I don’t have to worry about legacy code, and mainly I’m supporting Windows then it’s really quite cozy.
That's a solid description. I'm stealing that. "Cozy" is an excellent word for that sets C# apart from other languages.
The graph goes up for me when I find my comfortable little subset of C++ but goes back down when I encounter other people's comfortable little subset of C++ or when I find/remember another footgun I didn't know/forgot about.
That's one thing that always shocks me. You can have two people writing C++ and have them both not understand what the other is writing. C++ has soo many random and contradictory design patterns, that two people can literally use it as if it were 2 separate languages.
When I became a team leader at my last job, my first priority was making a list of parts of the language we must never use because of our high reliability requirement.
Care to share any favourites?
strtok is a worst offender that comes to mind. Global state. Pretty much just waiting to bite you in the ass and it did, multiple times.
Sure, strtok is a terrible misfeature, a relic of ancient times, but it's plainly the heritage of C, not C++ (just like e.g. strcpy). The C++ problems are things like braced initialization list having different meaning depending on the set of available constructors, or the significantly non-zero cost of various abstractions, caused by strange backward-compatible limitations of the standard/ABI definitions, or the distinctness of vector<bool>
etc.
Hot take, C is better then C++. It really just has one unique footgun, pointers, which can be avoided most of the time. C++ has lots of (smart)pointer related footguns, each with their own rules.
Yeah. My journey of love, loathing, hatred, adoration, and mild appreciation for C++, ended with the realization that 90% of the time I can get the job done in C with little hassle, and a consistent, predictable, trustworthy set of unholy abominations.
Then C++ what?