No, I am not going to read your crap, I've seen plenty of crap code in my life and I don't need to see more.

“Early returns are very common.

They mean less cognitive burden on the reader — “let’s get this simple case out of the way and forgotten”.

If you can’t wrap your mind around a simple function you might consider another line of work.

Besides, you've shown yourself to be a liar and a moron several times over; you have not read "millions" of lines of code, that would take lifetimes. Second, your objection to indentation is groundless and indefensible. I did my first several years of work on 80-column CGA monitors and even there indentation was better than the garbage of early returns. Yeah, they're common. So are failed companies and failed projects. When I stopped doing early returns my bug count dropped to zero; even only six years into being a developer I could do six weeks of work with zero testing, then less than an hour of manual testing, and have release-ready code. Intel excused me from meetings to let me work, which at Intel is like being crowned Pope.

You demand evidence that thrown exceptions are CPU-expensive. As if that's some mystery. Jesus Christ, you are a total know-nothing. Back when I was in Windows Mobile at Microsoft and they were having such awful performance issues on their phones someone profiled where the time was going and thereafter throw was forbidden in all WM code.

And you don't know this?

I'm not arguing early returns. The matter was settled for me a quarter century ago. I've used exactly three of them since then, all in

* performance hyper-critical code

* with nested loops

* where there was no cleanup at loop bottoms

and each time I put a HUGE comment block at

* the beginning of the function

* the end of the function

* at the mid-function return

explaining the reason for the horrible violation of clean structure.

And it's odd how the point has whooshed stratospherically over your head; yes real exceptions are rare, but hardly anyone restricts throw to actual exceptions. That's as clear as could be in my article but you still overlooked it. People use them to save time "refactoring."

Don't bother responding further. I've wasted as much time as I am going to on a halfwit like you.

Written by

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