this post was submitted on 09 Jun 2024
600 points (98.2% liked)

Programmer Humor

19452 readers
66 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 1 year ago
MODERATORS
 
top 31 comments
sorted by: hot top controversial new old
[–] [email protected] 92 points 4 months ago (2 children)

Don't get fooled, that's called stockholm syndrome.

[–] [email protected] 9 points 4 months ago (1 children)

I've met people with C++ Stockholm Syndrome, and I think their trajectory is different. There's no asymptotic approach toward zero; their appreciation just grows or stays steady, even decades into their career.

[–] [email protected] 1 points 4 months ago
[–] [email protected] 2 points 4 months ago

Stockholm Syndrome + Sunk Cost Fallacy + some of the better languages have lackluster corporate backing and/or third party libraries

[–] [email protected] 34 points 4 months ago

This is quite accurate.

Source: I've been in this journey.

[–] [email protected] 28 points 4 months ago

You start out with negative knowledge in C++, then as you just hear the name for the first time, you get your balls stepped on, jizz, and then get post-nut clarity.

[–] [email protected] 21 points 4 months ago

your underflow error is someone's underflow feature (hopefully with -fwrapv)

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

F(c++)=1/c++

[–] [email protected] 9 points 4 months ago (5 children)
[–] [email protected] 34 points 4 months ago (1 children)

Well, there's modern C++ and it looks reasonable, so you start to think: This isn't so bad, I can work with that.

Then you join a company and you find out: They do have modern C++ code, but also half a million lines of older code that's not in the same style. So there's 5 different ways to do things and just getting a simple string suddenly has you casting classes and calling functions you have no clue about. And there's a ton of different ways to shoot your foot off without warning.

After going to C# I haven't looked back.

[–] [email protected] 16 points 4 months ago (2 children)

And even if you do get to use pure modern C++ you'll still get burned by subtle cases of undefined behavior (e.g. you probably haven't memorized every iterator invalidation rule for every container type) that force you to spend weeks debugging an inexplicable crash that happened in production but can only be recreated in 1/10000 runs of your test suite, but vanishes entirely if you compile in debug mode and try to use gdb.

[–] [email protected] 5 points 4 months ago (1 children)
[–] [email protected] 9 points 4 months ago

I'm not sure if you're genuinely asking what a test suite is or if this is a sarcistic joke about how no one bothers to test their C++ code.

[–] [email protected] 3 points 4 months ago (1 children)

This is why I moved over to Rust

[–] [email protected] 3 points 4 months ago (1 children)

🦀🦀🦀🦀🦀🦀🦀🦀

[–] [email protected] 0 points 4 months ago (1 children)

Rustacean supremacy (not to be racist, because we avoid race conditions in the first place)

[–] [email protected] 2 points 4 months ago (1 children)

Sorry to be pedantic but Rust only guarantees no data races can happen. It does not prevent race conditions more generally.

Don't get me wrong, I absolutely love the language for sparing me from the hell that is data races, but the language alone won't solve race conditions for you.

[–] [email protected] 1 points 4 months ago

Man, you had to go and rain on my parade. 😞

[–] [email protected] 13 points 4 months ago
[–] [email protected] 9 points 4 months ago

Depends on your frame of reference.

[–] [email protected] 7 points 4 months ago

It's C with feeping creaturism. Some of the features are good. Others not so much. Personally I agree with Torvalds overall.

[–] [email protected] 5 points 4 months ago (1 children)

It's a decent language I guess. My main criticism is that the constructor paradigm just isn't well suited for RAII. I always find myself retrofitting Rust's style of object creation into my C++ code.

[–] [email protected] 3 points 4 months ago

Yeah exactly what I experienced. You just end up rewriting Rust constructs!

[–] [email protected] 8 points 4 months ago

Needs a sinusoidal wave added to it all.

[–] [email protected] 3 points 4 months ago (1 children)

Oh gawd I have to learn it for my grads

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

you should disagree

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

The fun thing is that, C++ being C++, this is actually an std::overflow_error...

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

I have zero context this graph is confusing af but also says so much

I just don't know how to translate it lul

[–] [email protected] 22 points 4 months ago (2 children)

When learning c++ you hate c++. Then suddenly you get it, and love c++. Then you learn more c++, and you end up merely liking c++

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

And as your knowledge tends toward expertise your love of the language approaches zero

[–] [email protected] 3 points 4 months ago