News for hackers. Stuff that matters.
Re:Avoid Else, Return Early (2013) by rukuu001 on Tuesday March 27, 2018 @02:06AM (#16685714)
We were taught "one entry, one exit".

I now think of the early part of a function as a filter for bad params, invalid state & whatnot, and return as early as possible.

Code just feels less complex that way.

There are no comments on this comment yet.