this post was submitted on 06 Oct 2026
468 points (99.0% liked)

Greentext

8811 readers
999 users here now

This is a place to share greentexts and witness the confounding life of Anon. If you're new to the Greentext community, think of it as a sort of zoo with Anon as the main attraction.

Be warned:

If you find yourself getting angry (or god forbid, agreeing) with something Anon has said, you might be doing it wrong.

founded 3 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] Eggymatrix@sh.itjust.works 35 points 3 days ago (3 children)

That was the point 20 years ago. These days it is pivoting to compile time functional programming

[–] Hadriscus@jlai.lu 22 points 3 days ago (3 children)
[–] e8d79@discuss.tchncs.de 28 points 3 days ago (3 children)

If you have a constant expression like 1 + 2 in your code you can evaluate it at compile time once and avoid computing it at runtime. You can do that with control flow and much more complex language constructs in C++. If you want to know more about that look into C++ template meta programming, constexpr, and constval.

[–] Amir@lemmy.ml 54 points 3 days ago (2 children)

Or don't look into those things if you wish to remain sane

[–] 87Six@lemmy.zip 15 points 3 days ago (1 children)

Templates are cool as fuck tho... For like 5 minutes until you go insane

[–] Amir@lemmy.ml 7 points 3 days ago

I get that the designers wanted to have compile time static replacement but this was not the way to do it.

[–] protogen420@lemmy.blahaj.zone 9 points 3 days ago (1 children)

yeah, zig and rust have the same concepts but much better thought and structed

[–] rtxn@lemmy.world 10 points 3 days ago (1 children)

It's easy to build a well-designed language when you don't have to work around the mistakes of the past that were too difficult to solve then and too deeply entrenched to change now.

[–] protogen420@lemmy.blahaj.zone 12 points 3 days ago (1 children)

yes, thats why I dont bother finnishing projects

[–] tomenzgg@midwest.social 11 points 3 days ago

To be fair, I never fully understood why programming projects have to be native Finlanders, in the end.

[–] timochka@lemmy.zip 8 points 3 days ago

Translation: "We've made the preprocessor a first-class language feature!"

(jk, don't kill me)

[–] Hadriscus@jlai.lu 2 points 3 days ago
[–] ddplf@szmer.info 10 points 3 days ago (1 children)

it means rust is cool as fuck

[–] Hadriscus@jlai.lu 2 points 3 days ago (2 children)

aren't they talking about C++ ?

[–] ddplf@szmer.info 10 points 3 days ago (1 children)

C++ has pretty much no compile-time checks, while Rust's overengineered syntax allows it's compiler to catch vast majority of your everyday errors during compilation.

[–] Hadriscus@jlai.lu 3 points 3 days ago
[–] asdfasdfasdf@lemmy.world 3 points 3 days ago* (last edited 3 days ago)

Rust is a very modern alternative to C /C++.

[–] red_tomato@lemmy.world 7 points 3 days ago

Overengineered mess

C++ has a lot of terrible language features because it would allow some 8 bit embedded CPU to dynamically change from LSB to MSB ordering in the middle of decoding some input. 🙈

[–] protogen420@lemmy.blahaj.zone 2 points 3 days ago (1 children)

does anyone actually follow whatver the comittee sees as best practices?

[–] e8d79@discuss.tchncs.de 3 points 3 days ago

I think the closest to an actual answer you will find are the cpp core guidelines.