this post was submitted on 13 Jul 2026
113 points (96.7% liked)

Programmer Humor

32263 readers
1644 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 3 years ago
MODERATORS
 

Edit: sorry I didn't realize I already posted this

top 24 comments
sorted by: hot top controversial new old
[–] Kenny2999@lemmy.world 63 points 1 day ago (1 children)

The difference is meaningless for large values of C.

[–] csm10495@sh.itjust.works 5 points 1 day ago (1 children)

Though if it's a signed number a large enough value can become a negative.

[–] ChaoticNeutralCzech@feddit.org 2 points 21 hours ago

If it's a float, it will stop incrementing when the precision stops covering every integer

[–] olafurp@lemmy.world 24 points 1 day ago (3 children)

I watched an hour long video on why C++ sucks. I thought it wouldn't be too hard to pick up since I can program well in probably 7 languages. I was wrong, now I'm convinced C++ is a dumpster fire and needs to die and I'll never get a job in it unless someone holds a gun to my kid.

[–] sp3ctr4l@lemmy.dbzer0.com 1 points 14 hours ago (1 children)

Genuine question:

Would you have a reccomendation for a comparable alternative?

Like, I have experience with a good deal of scripting languages, sql variants... am currently trying to do Morton coding/interleaving for octrees in Godot.

I have the framework working in GDScript... theoretically, if its not performant enough, i could either attempt to transition it to C++ / GDExtension... or, potentially, I could do a 'Rustdot' type thing, apparently its possible to... do that.

So, while I am only really aware of Rust as a potential alternative to C++, in my specific context... would you have a broader opinion of lower level languages? I just actually don't know much about them.

[–] olafurp@lemmy.world 1 points 10 hours ago* (last edited 9 hours ago)

I mean, gdscript in godot is very nice and convenient. It offloads a lot of the heavy labor to the engine already and is very well optimised. If you need more speed and type safety C# is the logical next step. C# is very convenient and easy to pick up if you already know Typescript for being a strict language.

Also the guy's criticism of C++ is basically that nothing is bundled in and keeping libraries compatible with each other is a PhD level activity. The packages are also allowed to fuck with your code with macros, preprocessing directives etc. on top of being written in a non-compatible standard where they only provide a compiled binary with an ABI instead of giving you the source. Updating dependencies becomes a massive pain also because of the same reason since it can so easily break everything without any reasonable stack trace. You might say "Ok whatever, I'll just preprocess my C++ and rename all by variables" but dependencies can also break other dependencies with macros so there's no escape. One dep updates, another one breaks in an 100% unrelated part of the program.

But for a reasonably sized project where C++ dependencies are already handled by Godot it's not that bad. Especially if you're the only developer or have at least good codebase standards on what parts of C++ you will use. I've personally not had any issues programming in C++ but that's probably because I've never done anything at any scale whatsoever.

I don't have a strong opinion on lower level languages since I work in garbage collected languages but I've heard good things about Zig, heard Rust in slow-mo development with a steep learning curve but very robust, C is nice and simple but lacks modern features.

TL;DR C++ devs would kill to get something like cargo in Rust, not because it's a package manager but because it's a standard for sharing code and managing compatability. If that's not an issue for you C++ is a solid language like any other.

To be fair, an hour long video about why C++ sucks maybe isn't the best source if you're trying to get a balanced view.

I'll out myself: I kind of like C++. Yes, it definitely has its sharp edges, but I like how much you can do with it. You can do object oriented, functional, procedural, in fact there's not much it can't do. You can stay high level or you can go very low level (pretty much just drop into C if necessary). Yes, it's complex, but once you have a decent feel for it you can do a massive amount with it, especially with the newest versions. And that despite it running on bare metal without any VM or anything. Probably the most frustrating part for me is that the standard library is in many cases stuck with old C++ paradigms. But otherwise, I like C++.

[–] slazer2au@lemmy.world 3 points 1 day ago

Just hope the gun isn't in c++ otherwise it will blow off the shooters hand too.

[–] nightwatch_admin@lemmy.world 38 points 1 day ago (4 children)

It’s just C with a garbage collector built-in, so even easier, duhhh.

no that's the other c-and-four-lines, just arranged differently, the |||| are arranged in # for the garbage collected one, not ++

[–] thoughtfuldragon@lemmy.blahaj.zone 23 points 1 day ago (1 children)

I may have missed the joke but C++ doesn't have built in garbage collector. Even recent versions of the standard merely allow it but don't specify it is required.

[–] mkwt@lemmy.world 0 points 21 hours ago

People have written garbage collectors for C++, but just about no one used the standard library support that was in the standard.

[–] pelya@lemmy.world 2 points 1 day ago

More like garbage dispenser.

Pro C++ coders don't use delete, they call abort()

[–] parlaptie@feddit.org 2 points 1 day ago (4 children)

Did you forget the /s or is this the tactic where you intentionally post wrong statements in order to get people to correct you so that you learn something?

C++ doesn't have a garbage collector

[–] call_me_xale@lemmy.zip 22 points 1 day ago* (last edited 1 day ago) (1 children)

I think the "duhhh" is a pretty good stand-in for a sarcasm marker

[–] cactusupyourbutt@lemmy.world 0 points 14 hours ago

just make everything a shared_ptr and it kinda does

[–] solrize@lemmy.ml 2 points 1 day ago

A garbage collector is just a monoid in the category of endofunctors, what's the problem?

[–] FelineFanatic@lemmy.ml 23 points 1 day ago (2 children)

Well its got the ++ right there, so its exponential!

[–] SpaceNoodle@lemmy.world 34 points 1 day ago

No, it's just incremented

[–] Evotech@lemmy.world 6 points 1 day ago

Found the non programmer

[–] BoosBeau@lemmy.world 3 points 1 day ago

It's a single letter of the alphabet, it's LITERALLY so easy.