in reply to Re^13: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
in thread What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^15: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff (Use block if not postfix if References)
by eyepopslikeamosquito (Archbishop) on Oct 11, 2020 at 23:55 UTC | |
|
Re^15: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
by tobyink (Canon) on Oct 11, 2020 at 21:05 UTC | |
by GrandFather (Saint) on Oct 11, 2020 at 21:59 UTC | |
by tobyink (Canon) on Oct 12, 2020 at 00:27 UTC |