in reply to My coding guidelines
Excellent list. It's not often you see style guidelines along with some informative prose as to the why of the guidelines.
I was surprised by this part (24):
Note that there is whitespace between ++ and -- and their operands, and between -> and its operands.
What's the consensus on this one? I've always liked snug ++/-- and dereferencing:
++$wolverines; $rabbits--; $wombat->move(); $turtle = $menagerie->[4];
As opposed to:
++ $wolverines; $rabbits --; $wombat -> move(); $turtle = $menagerie -> [4];
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.
On a somewhat visually related note, the arrow form of the left-associative operator works well with whitespace, however:
%myhash = ( lizard => 'gecko' );
Whereas the equivalent comma operator is snug with the left operand.
Thanks again for the list,
Matt
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: My coding guidelines
by Abigail-II (Bishop) on Nov 26, 2002 at 10:47 UTC | |
by mojotoad (Monsignor) on Nov 26, 2002 at 17:22 UTC | |
by helgi (Hermit) on Nov 28, 2002 at 16:35 UTC | |
by mojotoad (Monsignor) on Nov 29, 2002 at 23:38 UTC | |
by Aristotle (Chancellor) on Nov 30, 2002 at 18:18 UTC | |
by helgi (Hermit) on Dec 02, 2002 at 16:27 UTC |
In Section
Meditations