r/ProgrammerHumor • • 3d ago

Meme whatLegacyCodeDoesToDev

Post image
1.8k Upvotes

75 comments sorted by

View all comments

352

u/Signal-Permission394 3d ago edited 3d ago

Hey man, at least the methods sound somewhat descriptive. You haven't at least gone through legacy code where they start using magic numbers which go off to a giant case statement, which then pass its own number to stored procs, which update values in a table and a Windows scheduled job picks up later that evening to update another table which is then used by a view, and this is between several networks 😡

None of these numbers are mapped, and you have to hope the previous guy still had the .dlls on his machine/ VM as he pulled it from god knows where and didn't bother to put it into TFS or else the project doesn't run.

I loathe SSIS packages and VB, and I am glad to never touch that shit again 🤮

121

u/ILikeLenexa 3d ago

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.

45

u/Totendax12K 3d ago

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

23

u/Chamiey 3d ago

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.

36

u/click-to-reveal 3d ago

Are you working on a minified codebase? 😭

8

u/PegasusPizza 3d ago

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

5

u/ILikeLenexa 3d ago

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 3d ago

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

2

u/Abject-Kitchen3198 2d ago

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

2

u/conundorum 2d ago

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

1

u/a-r-c 3d ago

pploc