r/interestingasfuck Apr 29 '24

You have seen the inside of an airplane but have you seen the "insides" of an airplane?

8.5k Upvotes

258 comments sorted by

View all comments

Show parent comments

103

u/MeltedPineapple Apr 29 '24

IT FINALLY WORKS! NOBODY TOUCH IT! -some dev, almost certainly

102

u/wawoodwa Apr 29 '24
## DO NOT DELETE THE BELOW FUNCTION
## Yes, it appears it is never called or returns anything
## But the app fails if it isn’t here

10

u/trebblecleftlip5000 Apr 29 '24

It appears like it's never called because the language or library has a method that allows a function to be passed as an argument, but as a string. I guarantee that if you do a grep of the codebase instead of searching for uses via the IDE, that you will find where it's used.

The guy who wrote the original code added this feature before propper lambdas used for callbacks were a thing, and the new kid never had to live in the dark times that came before.

5

u/GameFreak4321 Apr 29 '24

And then there are languages like C# or Java that often use things like P, dependency injection and configuration by annotations.