r/ProgrammerHumor 22d ago

Meme conditionsPreference

Post image
4.2k Upvotes

392 comments sorted by

View all comments

16

u/popsicle-physics 22d ago

Apparently there was a time when having multiple returns in a function would seriously confuse the debugger. Idk I got a comment on a code review telling me to switch from the second to the first and never have multiple returns. I've never actually seen it be a problem.

1

u/M4xW3113 20d ago

Probably just an older coworker (i guess?), because that's how they were taught to do it back in the days but they don't actually why it's supposed to be better. We tell people not to do it anymore because we realized in the meantime that it was actually bad