this post was submitted on 08 Jun 2024
1065 points (98.5% liked)

Programmer Humor

19821 readers
73 users here now

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

founded 2 years ago
MODERATORS
 
(page 2) 50 comments
sorted by: hot top controversial new old
[–] [email protected] 32 points 6 months ago

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...

[–] [email protected] 56 points 6 months ago (2 children)

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.

[–] [email protected] 10 points 6 months ago (1 children)

i like to think of C++ as a testing ground for new features and paradigms. to see how some concepts will handle in production.

load more comments (1 replies)
[–] [email protected] 13 points 6 months ago* (last edited 6 months ago) (1 children)

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."

load more comments (1 replies)
[–] [email protected] 16 points 6 months ago (4 children)

I like C# better. Ok, I'll see myself out.

[–] [email protected] 6 points 6 months ago (4 children)
load more comments (4 replies)
[–] [email protected] 4 points 6 months ago (1 children)

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.

[–] [email protected] 2 points 6 months ago

That's a solid description. I'm stealing that. "Cozy" is an excellent word for that sets C# apart from other languages.

load more comments (2 replies)
[–] [email protected] 89 points 6 months ago (7 children)

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.

[–] [email protected] 44 points 6 months ago* (last edited 6 months ago)

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.

[–] [email protected] 35 points 6 months ago (1 children)

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.

[–] [email protected] 11 points 6 months ago (1 children)

Care to share any favourites?

[–] [email protected] 27 points 6 months ago (2 children)

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.

[–] [email protected] 13 points 6 months ago* (last edited 6 months ago) (1 children)

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.

load more comments (1 replies)
load more comments (1 replies)
load more comments (5 replies)
[–] [email protected] 49 points 6 months ago (16 children)

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.

[–] [email protected] 12 points 6 months ago

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.

[–] [email protected] 13 points 6 months ago

Then C++ what?

load more comments (14 replies)
load more comments
view more: ‹ prev next ›