In Perl you can write:
$i = 0 if $i < 0;
which reads nicely to me. That makes the conditional statement obvious and there is no clutter of brackets or parenthesis. In C++ (why would you ever use C?) I would write:
if (i < 0) i = 0;
I never append a statement like a wart I was trying to hide on the end of a conditional line. The important principle here is that important stuff should be at the start of a line because stuff at the end of lines doesn't exist. If the controlled statement is appended to the end of the line it gets lost. As an indented line on its own the controlled statement is visible and its relationship to the conditional statement is clear.
In reply to Re^14: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
by GrandFather
in thread What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
by likbez
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |