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

I tend to mix and match the two. The comma join looks way more natural to me. One thing I do habitually which I don't see other people do much is use aliases.

I learnt SQL through SAS which is where the excessive aliases came from and it kind of stuck with me.



If you write any decent amount of SQL and you dont alias, I will find you, and I will ... teach you a better way to code.

Most people don't have to do stuff in highly normalized systems, so when you write code that can have dozens of joins and potentially more predicates, you would go insane NOT using aliasing.


The "comma join" disconnects the join from the condition. It is hard to find the actual join condition between all the "where" conditions. By using JOIN ... ON .., you explicitly link tables with their join condition and also separate join conditions from other filter conditions on the "where".


The "comma join" disconnects the join from the condition.

Yes, because it's more important to first know what's being joined, then traverse that list looking for how it's being joined. You get the full name in the conditionals, so it's not like it's a mystery what they attach to.

But I have grey hair, so there you go.... :)

Comma syntax makes much more sense to me. But now I know that this is not The Way Things Are Done. I also learned from the comments that comma-first isn't recommended. So now my code will be more legible. It's all good.


I'm 45. I'm so old that I'm proficient using (+) to code outer joins in oracle :) Comma-join was the standard for me, and I had a hate-phase towards LEFT/RIGHT JOIN. But I must admin that once I've really tried the "new" join-on syntax it has great advantages that outweighs the pain of change.


Thanks. Good to hear!

I'm 51, and I'm a "full stack" programmer, which used to just be a regular programmer before everybody started overspecializing. When I learned programming, you met a guy, he told you what he wanted, and you made the computer do that. You didn't say "But I'm just the Java guy"

It wasn't that you were an expert in a dozen things, you just figured out whatever the heck you had to do.

I've kept with this philosophy and it's served me well.

So I dive in and out of SQL. I picked up my habits on SQL intensive projects in the 80s and 90s.

It'll be difficult for me to switch until I get into a spot where I'm using it heavily for a week or two. Hopefully I'll remember this thread then and give the new way a shot. Sounds freaky, but hell, I wasn't crazy about pointer arithmetic when I first heard about it either. :)




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: