If you wrote code that looked like that, I’d fire you.

It boggles my mind that people still do early returns. I was programming less than a year before I figured that out. That’s so wrong it doesn’t even go in coding standards documents. You just don’t do it. Early returns are the epitome of “junior.”

And it’s hard to figure out your point with all this

} else {

stuff. That’s hideous.

Learn to write legibly before you start trying to change the world.

The important point with if-else is to have the condition of correct operation in the if and the error condition in the else.

American Software Developer living in Vietnam. Classical musician (guitar, woodwinds), weightlifter, multilingual, misanthrope • XY

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store