in reply to "if" Considered Harmful in OO programming
Interesting post.
Any time I see something like
warning bells go off because I wonder if it could have been written asif ( $x and !$y ) { .. # true, false } elsif ( !$x and $y ) { .. # false, true } else { .. # true, true or false, false }
instead. Granted, this may not be required much of the time, but it sure makes code maintenance a year later a little easier.if ( $x ) { if ( $y ) { .. # true, true } else { .. # true, false } } else { if ( $y ) { .. # false, true } else { .. # false, false } }
Alex / talexb / Toronto
"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: "if" Considered Harmful in OO programming
by ikegami (Patriarch) on Sep 21, 2004 at 23:31 UTC |