bantu wrote:drathbun wrote:Comma on the left allows one to comment out a line of code without rewriting it.
In general this is not the case since you can not comment out the first line. The JavaScript notation supports spare comma on the left as much as it supports spare comma on the right: Not at all.
Furthermore, current coding guidelines apply and should be followed. If you think comma on the left is a useful change, please post in the coding guidelines topic instead.
Of course you cannot comment out the first line, that's true no matter where a comma exists. But you can comment out lines within the middle of a function call or sql script if the comma is on the left.
For example a SQL statement all on one line (not standard, just for example)
- Code: Select all
select a, b, c, d from table1, table2, table3 where join1 and join2 and join3
Same SQL statement formatted better, commas on the right:
- Code: Select all
select a,
b,
c,
d
from table1,
table2,
table3
where join1
and join2
and join3
Where are the "and" connectors? On the left. Not like this:
- Code: Select all
select a,
b,
c,
d
from table1,
table2,
table3
where join1 and
join2 and
join3
Comma on the left
- Code: Select all
select a
, b
, c
, d
from table1
,table2
,table3
where join1
and join2
and join3
Now, other than the required SELECT and FROM and WHERE statements, any individual line of code can be commented / removed without editing any other line of code. If a comma or connector (like "and" as mentioned above) is on the right rather than on the left, this is not true.
I realize this is a religious war much like whether { } should be on their own line or not.




