this post was submitted on 01 Aug 2025
163 points (99.4% liked)

Programmer Humor

25425 readers
983 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
you are viewing a single comment's thread
view the rest of the comments
[–] Lembot_0004@discuss.online 39 points 1 day ago (13 children)

It might be an absolutely adequate method. Imagine that is C++. operator-- is overloaded and controls some machinery. You can't just command capacity = currSize. Process is important.

[–] eager_eagle@lemmy.world 23 points 1 day ago (9 children)
[–] Lembot_0004@discuss.online 7 points 1 day ago (8 children)

That is why it is loved: it allows you to use ideas/objects the same way as you do as an engineer. Super cool.

[–] eager_eagle@lemmy.world 16 points 1 day ago (3 children)

yes, but in this particular case I wouldn't want to second guess my decrement operation just happens to also be calling the white house or whatnot. Just make a method.

[–] leo85811nardo@lemmy.world 2 points 1 day ago* (last edited 1 day ago)

That's just life of a C++ programmer: you second guess everything, and there are still optimization you haven't tried, and pitfalls you haven't got into

load more comments (4 replies)
load more comments (4 replies)
load more comments (7 replies)