this post was submitted on 14 Feb 2026
353 points (99.7% liked)

Programmer Humor

29741 readers
1146 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
[–] Avicenna@programming.dev 18 points 11 hours ago (1 children)

I can imagine multiple scenarios where this could be useful. Simplest is perhaps the coder imagined at the time they could extend the function in later stages.

[–] Jesus_666@lemmy.world 9 points 10 hours ago (2 children)

Then they could add their own function in later stages. YAGNI exists for a reason.

[–] LodeMike@lemmy.today 4 points 8 hours ago (1 children)
[–] bleistift2@sopuli.xyz 13 points 8 hours ago

“You ain’t gonna need it”. It means: Build the thing you need now and don’t try to predict what you’ll need in 3 years. You ain’t gonna need it anyway.

[–] Avicenna@programming.dev 8 points 9 hours ago* (last edited 9 hours ago) (1 children)

I think it is a balance. Despite having quite functional IDEs now a days, it is still more error prone to change 10 instances of math.random than a single function you define modularly. If you think there is a good chance such an extension might be needed in future or that you might want to change libraries later on, I wouldn't necessarily call this a bad decision, even if it goes unused.

YAGNI works best when it prevents adding complex unused futures which are error prone and complicates a simpler program logic and flow. In this case you are just encapsulating a function inside another one without any change to program complexity.

[–] Jesus_666@lemmy.world 2 points 8 hours ago

It definitely depends on the use case. I could accept this being abstracted out to facilitate mocking, for instance (although I'd recommend mocking at a higher level). But in general this wouldn't pass review with me unless I get a good explanation for why it's necessary.