note
mojotoad
Excellent list. It's not often you see style guidelines along with some informative prose as to the <em>why</em> of the guidelines.
<p>
I was surprised by this part (24):
<p><blockquote><em>
Note that there is whitespace between ++ and -- and their operands, and between -> and its operands.
</em></blockquote>
<p>
What's the consensus on this one? I've always liked snug ++/-- and dereferencing:
<p>
<code>
++$wolverines;
$rabbits--;
$wombat->move();
$turtle = $menagerie->[4];
</code>
<p>
As opposed to:
<p>
<code>
++ $wolverines;
$rabbits --;
$wombat -> move();
$turtle = $menagerie -> [4];
</code>
<p>
For that matter, I've always made unary operators snug so that you can immediately find it's operand. This might be a holdout from C, but I do actually find the snug form more aesthetically pleasing.
<p>
On a somewhat visually related note, the arrow form of the left-associative operator works well with whitespace, however:
<p>
<code>
%myhash = ( lizard => 'gecko' );
</code>
<p>
Whereas the equivalent comma operator is snug with the left operand.
<p>
Thanks again for the list,<br>
Matt
215675
215675