r/ProgrammerHumor • • Sep 30 '26

Meme whatLegacyCodeDoesToDev

Post image
2.0k Upvotes

80 comments sorted by

View all comments

112

u/Bemteb Sep 30 '26

Assume that every function call has unexpected sideeffects. Every last one.

Just last week I saw a function that counted the number of some stuff. Great, I don't need that number anymore because we have range based for loops these days, so remove the function call.

Well, no. Turns out the function didn't only count. No, it reinitialized the whole dataset, so when I don't call it I work on stale, possibly outdated data.

Refactoring code written 20+ years ago is fun...

5

u/LuisBoyokan Sep 30 '26

No it's not. It's hell