Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Am I the only one who puts commas on the next line? I think of them as an operator analogous to AND or ON:

    select
        t1.col1   as col1
        , t2.col2 as col2
        , t2.col3 as col3
It makes commenting out columns painless.


You're not the only one, but I wish you were, because then I'd have to read a lot less of it.

I doesn't eliminate your commenting problem, it moves your commenting problem from the last line of your list to the first.

Also, it is visually distracting as all get out.


> It makes commenting out columns painless.

No it does not. If you have to comment out the first column you'll have to remove the comma from the second column. It's the same problem that happens if you put the commas at the end of the line, except that the offending line will be the last column. So putting commas at the beginning just makes it look weird because it differs from how we use commas in natural language.


Exactly, You're also hiding the most important part of the line which is the variable name.


Same here ... except the first field would be on the same line as the select, and the comma would be aligned with select's "t"


Yes I do. As you say so I can comment out easily but not so much on with the 'as' and maintaining the river.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: