News for hackers. Stuff that matters.
Re:Avoid Else, Return Early (2013) by timoxley on Monday March 26, 2018 @11:14AM (#16679490)
I'm trying to imagine worst case scenarios here, and at least in an environment like JavaScript, I'm struggling to see how a beginner being overeager with early returns can possibly create anywhere near the same degree of mess as a someone overusing nested if/else statements.

Agreed on early returns being questionable for "two variations of the same concept" though, these days I generally use if/else for situations like that.

There are no comments on this comment yet.