The virtue of not using them is that successive indentation marks the path of successful execution and makes the scoping explicit. I have never understood why anyone gets stomach cramps at the sight of indentation.

Intangibly, using early returns encourages a bailout kind of thinking that shows up in a variety of bad practices.

I was coding less than three years when I decided to stop using early returns. My code got a lot better right away.

When I’ve been charged with developing coding standards I forbid ERs.

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