in reply to No braces
Less clutter and more readability, really. Kinda like Perl's trailing conditionals...
which then you can use to semi-duplicate in a twisted way C and Java's style:$x = 8 if $x == 7;
Update Fixed code example as per Abigail-II's reply. Sorry about that, and yes, the first is less efficient, but we weren't talking about efficiency here, only style (not to say it isn't a good point to bring up).$x = 0 unless $x == 7; $x = 8 if $x == 7; # ... or maybe ternary operator? ... $x = $x == 7 ? 8 : 0;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: No braces
by ff (Hermit) on Feb 11, 2004 at 06:15 UTC | |
by flyingmoose (Priest) on Feb 11, 2004 at 13:56 UTC | |
by hardburn (Abbot) on Feb 11, 2004 at 14:42 UTC | |
by flyingmoose (Priest) on Feb 11, 2004 at 15:03 UTC | |
by hardburn (Abbot) on Feb 11, 2004 at 15:26 UTC | |
| |
Re: No braces
by Abigail-II (Bishop) on Feb 11, 2004 at 10:49 UTC |
In Section
Meditations