in reply to Re^2: Reading Text Lines
in thread Reading Text Lines
if$.%100==0 is shorter and clearer than unless$.%100
I believe it's a matter of taste. My (maybe weird) way of thinking is that I'm interested in $a % $b when the modulo operator yields a false value, in the same way that I'm interested in $a == $b when the result is true. So, the alternatives are:
if $a % $b == 0 if !($a % $b) if not $a % $b unless $a % $b
To me, the clearest of them is the last one. Maybe it's because I use it regularly. Note that the one you said was shorter and clearer is the longest of that four, once we beautify the code.
--
David Serrano
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Reading Text Lines
by ikegami (Patriarch) on May 11, 2006 at 19:45 UTC | |
|
Re^4: Reading Text Lines
by rodion (Chaplain) on May 11, 2006 at 22:12 UTC |