Hacker News new | past | comments | ask | show | jobs | submit login

My personal style has a lot of similarities, but with some glaring differences. The biggest is that I put the comma in front of the next item, rather than trailing the one before. What this means is that when I add a new thing to the list of columns, I'm less likely to leave one out.

See http://bentilly.blogspot.com/2011/02/sql-formatting-style.ht... for what this looks like in practice.




I put the commas in front as well, but the reason I started doing it that way is that you can then comment out (and uncomment) any column without breaking the query.


I use this formatting style as well - it's also easier to format as the columns can all be aligned with tabs.


You also write FROM/JOIN/ON indentations like I do.




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

Search: