in reply to Clever vs. Readable

Don't forget the ultimate in readability, clunkiness, and lack of cleverness: (for new programmers)
my $min; if( $a <= $b){ $min = $a}else{ $min = $b }

I'm not really a human, but I play one on earth Remember How Lucky You Are

Replies are listed 'Best First'.
Re^2: Clever vs. Readable
by Your Mother (Archbishop) on Aug 09, 2008 at 20:53 UTC

    Yeah, but what happens when this simplistic (not simple) approach is taken in the wild is that the if/else grows into a 300 line if/elsif and the else to catch fail cases never seems to be there. I'm going through this again at work because a very experienced and generally intelligent manager there would rather do an open-ended if/elsif tree than a hash lookup, "Because it's easier to read."

Re^2: Clever vs. Readable
by JavaFan (Canon) on Aug 09, 2008 at 20:55 UTC
    In that case, I'd prefer ALGOL:
    min := IF a < b THEN a ELSE b FI;
    (It's a long time since I last coded in ALGOL, so I might have details of the syntax not correct).