r/ProgrammerHumor • • Sep 30 '26

Meme whatLegacyCodeDoesToDev

Post image
2.0k Upvotes

80 comments sorted by

View all comments

Show parent comment

12

u/BastetFurry Sep 30 '26

At least QBasic has the somewhat sane idea that you simply set the function name to the variable you want to return.

i.e.:
Function Foo(bar,baz)
Foo = bar*baz
End Function

But that? That is evil.

10

u/requion Sep 30 '26

I normally don't wish harm upon anyone. But having to work with Ruby for some time now, i sincerely wish whoever made these decisions to stub their little toes on furniture twice every day.

9

u/Deciheximal144 Sep 30 '26

I don't think it's intuitive to use the function name is the keyword for return at all. I've got other code I want to reuse and paste in to a new function I'm making with few changes, now I've got to change all the return instances to the new function name. What was so wrong with a command like RETURN?

4

u/EvilCodeQueen Oct 01 '26

Or if a function isn’t explicitly returning something, just do void, or null. But the language deciding for you that it must return something and if you don’t choose, it will? That’s just crazypants.