Re: Multiple returns vs. Single exit

Jeff Kesselman <[email protected]> Fri, 28 Dec 2007 19:30:52 -0500
Newsgroups gmane.comp.windows.devel.java.advanced
Message-ID <[email protected]>
Attila Szegedi wrote:
> On 2007.12.28., at 21:47, Mark Gorokhov wrote:
>
>> Dmitry Beransky wrote:
>>> Does it have to be an "either-or" decision?  Whichever approach makes
>>> the code more readable in a given situation is the one you should
>>> use.
>>
>> There is no "either-or" in our coding standards. We must use a single
>> return, no Hungarian notation (but "m_" is mandated), and so on.
>
> Heh - that's already partly Hungarian notation then. Charles probably
> doesn't read this list, so I don't think I'm running the risk of scorn
> next time I bump into him, but Hungarian notation is totally
> meaningless for a reasonably strongly typed language such as Java.
Amen.  I think you make your code a lot more readable if you fields a clear
amd easy to read name that well describes their purpose.

Any decent IDE these days will let me do a "jump to definition" if I
want to know
the exact type.



> It
> was sort-of okay for C where you could accidentally cast, say, a
> lpszFoo to iBar (but even there, a decent compiler would've warned you).
Well, what it was was a god awful hack to turn people's eyes into the
missing strong typing that the language needed.
>
>>
>>
>> We are reworking old code to meet our new coding standards.
>
> Ask your manager to provide you with a cost/benefit analysis they
> performed before deciding on this grandious waste of time.
And ask them if they've calculate in the cost of the new bugs introduced
in this procvess.

To quote a CPSR newsletter back when I was in college (and dinosaurs
roamed the earth):
Code and elevators are not the same.  Elevators break down if they
aren't maintained.  Code
breaks down only if it IS maintained.

I gotta agree with the others, honestly, ... sounds like Dilbert is in
the next cube over from yours...

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

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