Re: Multiple returns vs. Single exit

Randall R Schulz <[email protected]> Fri, 28 Dec 2007 12:26:47 -0800
Newsgroups gmane.comp.windows.devel.java.advanced
Message-ID <[email protected]>
On Friday 28 December 2007 11:52, Mark Gorokhov wrote:
> Our company has a coding standard which prohibits multiple returns
> from a method. I think that mandating to use a single exit from a
> method makes code less readable but I have to follow this standard.
>
> It seems to me that there is no agreement on this. Search returns
> many entries.
>
> ...
>
> This question is definitely not an advanced one but I'm interested in
> your opinion.

It serves no purpose other than to arbitrarily contort your code.

Even the most meager programmer's editor makes it easy to spot returns.

There is no value in such a mindlessly conceived rule.


We'd get a lot more out of countering the inexplicable urge 99.9% of all
programmers seem to have to cram any given body of code into the
tiniest imaginable amount of screen real estate.


> Thanks
> Mark G.


Randall Schulz

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com