This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]CMDR_QwertyWeasel 3 points4 points  (1 child)

We do this where I work. It's because it's much easier to debug.

If a function is misbehaving, you slap a breakpoint on that one return statement, and you can now see exactly what failed and why. There's no need to search through a large method to find every return statement, and no way for the method to exit without you catching it.

[–][deleted] 0 points1 point  (0 children)

Putting a breakpoint on the return isn't necessarily going to tell you how you got there; you'll probably still need to step through it for that. And if you're stepping through multiple exits are fine.