Noah Roberts wrote:
[snip]
I totally disagree with the examples in #39. COMMA FIRST!
function( param1
, param2
, param3 )
If you're going to split, do it. Don't mix and match; it's much harder
to read.
[snip]
Personally, I use the following style: blanks between function name
and parenthesis, comma attached to the word after which it comes.
function (param1,
param2,
param3);
That is what the German Duden (something similar to Webster's
dictionary, I guess) defines as typographic convention for machine-
written documents. Since this style is used for virtually any English
and German prose, I think that computer programs should adopt the same
style. After all, people who read a lot are quite adjusted to this
style, and would find a different style ugly.
Besides, the opening parenthesis provides a nice visual context for
the following parameters (which is another reason why the parenthesis
should be attached to the word inside the parenthesis and not to the
word outside).
However, I disagree with the other style that is suggested in #39: I
prefer the style where the operator is moved to the next line:
totalSum = a + b + c
+ d + e;
or even more detailed:
totalSum = (a + b + c)
* (f + g)
+ h + i;
This is more similar to what one gets teached in 2nd or 3rd grade for
addition of multiple numbers:
2341 totalSum = a
+ 543 + b
+ 182 + c;
------
3066
That's my 2cents.
Regards,
Stuart