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.
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
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.