top | item 25551879

(no title)

azisk1 | 5 years ago

For now it only upper-cases but I would like it to "prettify" the code as well. So it is an upcoming feature. Hopefully it will even suggest SQL code improvements in the future. Contributions are welcome

discuss

order

tuwtuwtuwtuw|5 years ago

I don't really get it. Is upper case more human readable than lower case?

cipher_system|5 years ago

Me neither, when copying uppercase sql i always lowercase everything. But I can understand that some people are more used to that format even though I find it obsolete.

In any case, it is objectively not more human writeable.

azisk1|5 years ago

Not for everybody probably but I find it more readable, especially when the queries get big. Some people rely on code highlighting but this usually gets messed up when writing SQL code inside Python strings

solidsnack9000|5 years ago

By distinguishing key words from table names and column names, uppercasing can improve readability, since SQL has such a flexible/variable grammar.

If we wrote:

    select(col1, col2, col3, ..., from=table_name, limit=5)
or something like that, it's obvious what are the intrinsics and what are the variable parts without knowing anything about select but for SQL you need to know all the "sentence patterns".

ComputerGuru|5 years ago

It’s actually been proved to be the opposite... which is probably why a lot of legalese you aren’t meant to read but they’re required to provide is written in small print upper case.

This has to do with the outline of letters in uppercase being indistinct (if you trace an outline - especially with serif fonts - you’ll largely just get a block) so you need to spend more time per-letter to distinguish the characters whereas with lowercase, the “fitted box” shape is shared between fewer letters: https://www.sciencedirect.com/science/article/pii/S004269890...