Hacker News new | ask | show | jobs
by DKnoll 2821 days ago
Yours is a fair opinion and I can't come up with any reason why it's wrong.

Personally I like it because it clearly separates keywords from objects (tables, columns, databases, etc).

This is very much like the tabs vs. spaces debate.

1 comments

Syntax highlighting already clearly separates keywords from everything else, and more flexibly to individual taste. (The keywords being both uppercase and bright bold purple on the linked page here particularly caught my personal distaste.)

Certainly there are still far too many places people are writing/reading/interacting with SQL without the benefit of syntax highlighting, but we have the technology to solve that (and in many cases need to solve that; a lot of the places that SQL is embedded and the outer language has no idea about are opportunities for SQL injection attacks).

> This is very much like the tabs vs. spaces debate.

It's sadly worse than that. It's something like 60 years of momentum versus user/developer experience and readability concerns.

Despite my under-appreciated jokes that most SQL databases probably don't need to be shouted out to do their jobs (Oracle maybe being an exception. ;), it actually is a serious readability issue.

We have decades of research showing that people read/scan by word shape and that lower-case and mixed-case is far faster and easier to scan/read than all caps. 'from' has a more interesting and relatively more unique shape than 'FROM', making it easier to spot. (Especially in a monospace language where the outermost shape of all four letter all caps words is essentially the same width and height rectangle.) (If you try a syntax highlighting scheme that does something more interesting than bolding keywords, italicizing them with a good italic monospace font, the lower-case word 'from' can be almost beautiful and very easy to find. A nice benefit to syntax highlighters is that sort of variation is a personal option between you and your editors of choice.)

Typesetters have known for a long time that all caps is slower to read, and should be used sparingly because it exhausts readers.

Sentence-casing SQL statements benefits from the readability of all the English we read everywhere else.

I make jokes about shouting in our database queries, because it's sadly easier than changing more than a half-century of momentum in the status quo, but I do think that all-caps keywords in SQL statements is a huge papercut in dev productivity/ergonomics that we have the technology to fix but apparently not the interest/willpower.