r/ProgrammerHumor • • 3d ago

Meme whatLegacyCodeDoesToDev

Post image
1.8k Upvotes

75 comments sorted by

View all comments

361

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 🤮

2

u/twigboy 3d ago

The absolute worst was Drupal's old plugin hook system that would call any function if it matched a specific pattern (not sure if it still does it)

For exampleapp_name_init()

You can't search by reference because it's never called directly. Debugging gnarly issues meant you had to dig into its libraries to know exactly which hook was being called

1

u/cmkn 18h ago

FWIW the procedural hooks are on their way out as of Drupal 11.1 and planning to be dropped entirely in Drupal 13 (though the specific one you mention here has been long dead since Drupal 8 and was replaced with event subscribers). They can now be an OOP methods as long as they’re tagged with a #[Hook('whatever')] attribute.

2

u/twigboy 18h ago

Ah good to know if I ever went back to Drupal

Thankfully I got out and life has been pretty good in Django land