Hi Kevin
Message: 2
Date: Mon, 26 Jun 2006 10:01:21 -0400
From: Kevin Cully <[EMAIL PROTECTED]>
Subject: Re: Strong parameter checking
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
I would guess that it's a matter of preference but I never like to
RETURN in the middle of a function. I think keeping this philosophy
forces modularity and keeps my functions small which hopefully increases
their re-use. With smaller (shorter) functions, it also keeps the
indentation to a minimum. Yes, I do end up with many more
methods/functions though.
The way you combined the commands, you've already decreased the number
of indentations compared to the way that I wrote it out, which is a
plus. Dominic's CASE .. ENDCASE decreases the indentation levels as well.
Thanks.
I've started to think personal preference is too valued. Engineering
should be more important. Standards should be more important. In other
words, you show me a good reason to do something and I'll drop my
"personal preference" in a flash.
I'm returning from the beginning of the function, not the middle. ;)
However, using objects that remember settings, you can safely exit
almost anywhere. The objects will restore settings when they are
destroyed. If it's safe and allows me to have the meat of the function
clearly delineated and uncluttered, then that outweighs
habits/traditions/personal preference.
I too have lots of tiny functions. That's what increases their reuse,
regardless of where you return from the function. Those issues are not
causally related. Size depends on the task. The bigger functions often
reuse the little ones. This is the way the universe is organized.
HTH
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.