Paul Johnson wrote:

> To my mind,
>   return if $target eq "MAIN";
> at the top of a sub is a lot more helpful than making me search all the
> way down to the botttom to see if there is anything after the conditional.
>
> And it's probably a lot less likely that the next person to edit that sub
> will goof up by adding something where it shouldn't be.
>
> Slavish devotion to the single exit point paradigm can produce some
> wonderfully messy code, all scrunched up at the right of the screen.
>
> Then again, I probably wouldn't merge those two original lines either.
>
> --
> Paul Johnson - [EMAIL PROTECTED]
> http://www.pjcj.net

Ditto--on both points.  The original formulation was just fine.  Unless the $target 
variable was meant simply to decide on a return, it makes more sense to assign its 
value--one task, one line, and check it for validity--another task entirely, on a line 
of its own.  The only thing it lacked was a meaningful return value.  Since the 
getTarget function provided enough information to decide in favor of an early exit, 
this information should probably be passed on more explicitly, perhaps just by 
returning 0 rather than undef.

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to