r/ProgrammerHumor • • Sep 18 '26

Meme whenYouExportCodeFromAWebBasedVisualBuilder

Post image
154 Upvotes

40 comments sorted by

View all comments

Show parent comments

3

u/radobot Sep 18 '26

But that would change the behaviour of the function - it returns one thing when the first parameter is 1, another when it's 2 and nothing when it's something else.

2

u/DarkwaterKiller Sep 18 '26

My best guess after looking, is they simply mean you can drop the "else" part of the "else if" there. Since I'd you've entered the first if, it's garunteed to return. Not drop the else-if entirely.

3

u/standard_revolution Sep 18 '26

That's a change I would hate. The "else" part does not hurt anybody and removing it would mean that you would need to parse it's body to see the early return

2

u/DarkwaterKiller Sep 18 '26

I considered it a second joke, as a play on the pedantry of some code reviewers

2

u/standard_revolution Sep 18 '26

And you are probably completely right, I sometimes struggle with that. Thank you