|
|
On 5/3/2011 8:50, Warp wrote:
> What's wrong with:
The "else" doesn't end the function, and I tend to have several of these in
a row, and sometimes it's inside a loop, etc.
> (Structured programming purists would recommend doing it like that
> because there's no early return.)
I could restructure things, sure, but then it's even more verbose and unlike
my initial thought processes. Structured programming wouldn't let me return
a value from the middle of the function either. It's the asymmetry between
a return after a void call and a return after a value-producing call that is
ugly.
(I had to giggle yesterday when I added an "else break" as the last
statement of a do-while loop, too.)
--
Darren New, San Diego CA, USA (PST)
"Coding without comments is like
driving without turn signals."
Post a reply to this message
|
|