r/ProgrammerHumor • • Sep 30 '26

Meme whatLegacyCodeDoesToDev

Post image
2.0k Upvotes

80 comments sorted by

View all comments

Show parent comment

128

u/ILikeLenexa Sep 30 '26

My absolute favorite one was an app that took 14 single letter URL parameters on every GET request and assigned them to single letter variables.

You'd think they were being charged by the keystroke.

48

u/Totendax12K Sep 30 '26

you know you found the true legacy code when they did shit like that.

27

u/Chamiey Sep 30 '26

I once had to work with a front-end code that did pack 6 boolean flags into an integer by bit manipulation. Only to send it as one of the stringified JSON values, of course.

35

u/click-to-reveal Sep 30 '26

Are you working on a minified codebase? 😭

10

u/PegasusPizza Sep 30 '26

No you see, it's saving internet bandwidth by doing that. We can't afford transmitting 14 entire words.

5

u/ILikeLenexa Sep 30 '26

I mean, I get that, and the URL length limit in some browsers especially with multi-byte character possibilities, but I don't understand why you wouldn't name the variables full words once you pull the strings from the params map.

6

u/gjk-ger Sep 30 '26

Do you know how much memory cost back then?! (Or, now...)

2

u/Abject-Kitchen3198 Sep 30 '26

I refactored my code to use single letter variables and two letter method names. Saved me a ton of money on RAM and storage.

4

u/conundorum Sep 30 '26

Screen size limitations, when coding on one of those toys you get from a Happy Meal?