this post was submitted on 15 Sep 2025
95 points (89.9% liked)

Programmer Humor

26668 readers
1784 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
 
top 18 comments
sorted by: hot top controversial new old
[–] SpaceNoodle@lemmy.world 36 points 2 weeks ago (1 children)

I don't get it. What's wrong with constexpr? It's vastly preferable to macros due to type safety, and const due to compile-time optimization.

[–] RustyNova@lemmy.world 13 points 2 weeks ago (2 children)

I don't get it either. OP might be angry at compile time (Couldn't be worse than rust)

[–] anton@lemmy.blahaj.zone 7 points 2 weeks ago (2 children)

Rust doesn't allow type inference in function signatures, c++ does with auto. IIRC, they recommended against using it, because of -you guessed it- compile time.

[–] SpaceNoodle@lemmy.world 4 points 2 weeks ago

Yeah, Rust already has major compile time issues.

[–] RustyNova@lemmy.world 3 points 2 weeks ago (1 children)

TBH I thought it was for refactoring type safety. Making sure that the type is understood and not ready to just change wildly accidentally.

[–] SpaceNoodle@lemmy.world 1 points 2 weeks ago

I thought that was part of the point - simplifying refactoring.

[–] SpaceNoodle@lemmy.world -5 points 2 weeks ago (1 children)

Not fair to compare it to the very immature Rust.

[–] RustyNova@lemmy.world 7 points 2 weeks ago (2 children)

I do love rust. But I do like making fun of it too.

Although I don't see how rust is immature? Unless I missed the joke?

[–] squaresinger@lemmy.world 3 points 2 weeks ago

Well, compared to grandpa C++ over there...

[–] SpaceNoodle@lemmy.world -5 points 2 weeks ago (2 children)

It's very young for a programming language, and is still rapidly evolving.

[–] calcopiritus@lemmy.world 4 points 2 weeks ago

It's more than 10 years old. It has stable syntax, big standard library, big library ecosystem, plenty of rust programs already in production.

If by "evolving" you mean "changing", I don't think that is an issue at all. At most, they add features. They don't change or remove. And with the editions system, it should be no issue.

If by "evolving" you mean "improving", then I don't see how that could ever be an issue.

[–] anti_antidote@lemmy.zip -1 points 2 weeks ago

It's only a third of the age of C amirite 🙄

[–] aaaaaaaaargh@feddit.org 26 points 2 weeks ago (1 children)

What!? constexpr is one of the best additions to C++ ever since. And I do like auto even though I get why some folks can't stand it.

[–] ulterno@programming.dev -2 points 2 weeks ago (1 children)

Yeah, it's so good that reality is flaking at the edges because of using constexpr auto x = whatever().

[–] aaaaaaaaargh@feddit.org 2 points 2 weeks ago (1 children)

Well... and what would be the meta templating equivalent to this statement?

[–] ulterno@programming.dev -1 points 2 weeks ago

Yeah, it’s so good that reality is flaking at the edges because of using

[–] KindaABigDyl@programming.dev 4 points 2 weeks ago* (last edited 2 weeks ago)

Wdym? They're so good they even got backported to C in C23

You know how often C gets big features like that? I mean to get auto they had to basically deprecate a keyword (well, sort of)

[–] tyo_ukko@sopuli.xyz 1 points 1 week ago* (last edited 1 week ago)

I much prefer for (auto map : hashMaps) ... over for(unordered_map<string, unordered_set<string>> map : hashMaps) though. Shame they didn't name it "var" like in many other languages, auto just reminds me of cars.