in reply to A matter of style
I'll never return from the "middle" of a routine as i find it makes debugging a little more difficult as there are multiple "areas" where the routine can be exited from. Beside the semantic validation at the top of the routine the exit will always be at the bottom before the }
Purists say there should only be one entry and one exit and anything else is obfu. What do you say?
For values of "purists" equal to "unreformed Pascal programmers". Sure, returning from all over your subroutine might be disorienting, but so will the contortions you're going to go through to return once from a routine that damn well should have multiple exit points. The same argument applies to other purist bugbears, like gotos and global variables. They can make your code harder, or easier, to read, depending on the problem and the circumstances. Ignoring them out of some bizarre sense of ideological purity is stupid.
--
F
o
x
t
r
o
t
U
n
i
f
o
r
m
Found a typo in this node? /msg me
The hell with paco, vote for Erudil!
|
---|