Rob Dixon said: > > "Rob Richardson" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Stefan, >> >> Personally, I'd prefer: >> >> if (target ne "MAIN") >> { >> #do lots of other stuff >> } >> >> I think general programming practice discourages multiple return points >> in subroutines. > > Yes, and it's no more dangerous than multiple 'last' statements in loops.
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 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]