4 ms·
I find all caps identifiers wind up just looking like interchangeable blocks, where lowercase have word shapes. So all caps just slows down my reading.
by wiredfool 2y ago
I find all caps identifiers wind up just looking like interchangeable blocks, where lowercase have word shapes. So all caps just slows down my reading.
- WorldMaker 2y agoI feel similarly and I also have friends with Dyslexia with even stronger opinions on it. All caps in addition to being "shouting" to my ancient internet-using brain (and thus rude in most cases), creates big similar rectangular blocks as word shapes and is such a big speed bump to reading speed for everyone (whether or not they notice it). For some of my friends with Dyslexia that have a huge tough time with word shapes at the best of times, all caps can be a hard stop "cannot read" blocker for them. They say it is like trying to read a redacted document where someone just made rectangular black marker cross outs. Personally, given SQL's intended similarity to English, I find that I like English "sentence case" for it, with the opening keyword starting with a capital letter and nearly every remaining letter lower case (except for Proper Nouns, the truly case-sensitive parts of SQL like table names). Sentence case has been helpful to me in the past in spotting things like missing semicolons in dialects like Postgres' that require them, and/or near keywords like `Merge` that require them or helping to visually make sure the `select` under a `Merge` is intended as a clause rather than starting a new "sentence".
- akira2501 2y ago> I find that I like English "sentence case" for it, I could go either way, but if you want to go back and modify a query, this makes it more difficult for me. I just use a block syntax for my queries: SELECT * FROM the_table WHERE some_column = 12 AND other_column IS NOT NULL ORDER BY order_column;
- cwbriscoe 2y agoSELECT * FROM the_table WHERE some_column = 12 AND other_column IS NOT NULL ORDER BY order_column; I usually don't bother with ALL-CAP keywords.
- wruza 2y agoI use a similar structure but without column alignment. SELECT a, b FROM t1 JOIN t2 ON … WHERE cond1 AND cond2 ORDER/GROUP/HAVING etc
- justanorherhack 2y agoThis is the way, everyone else is wrong.
- WorldMaker 2y agoIt's a bit of a "Why not both?" situation, I think? You can have blocks and sentence case: Select * from the_table where some_column = 12 and other_column is not null order by order_column; That seems so much more readable to me. As I said, that single capital `S` in the outermost "select" has come in surprisingly handy in my experience when scanning through a collection of statements or a transaction or a stored procedure or even just a statement with a bunch of nested sub-selects. It's an interesting advantage I find over "all lower case" or "all upper case" keywords.
- 4ggr0 2y agoyour example is less readable for me. not by a lot, but still. the other example has the commands, in caps, on the left and the values on the right, in lowercase. your example removes one of those aspects and makes everything lowercase. my brain can ignore all-caps stuff, as these are just commands and the things i actually care about mostly are the values. but i mean, in the end, it's just preferences. if you write SQL-queries, #1 is that you understand them well :)
- Ntrails 2y ago> your example is less readable for me. not by a lot, but still Agree, but I wonder how much of that is just the lack of colouring. My brain is suuuuper hard wired to expect all the special keywords to be identified that way as well as by case. Mostly I'm a caps guy because my ahk scripts expand text like "ssf","w" and "gb"* to be the way I learned to write them at first.
- andrei_says_ 2y agoAlso sql editors like datagrip color the sql syntax very well.
- yen223 2y agoI've always found it funny that SQL was designed the way it is to be as close to natural English as possible, but then they went ahead and made everything all-caps
- paulryanrogers 2y agoSome old terminals didn't have lower case. Like 1960s era
- conductr 2y agoI prefer lower case for my personal legibility reasons and it seems like a prettyfier should be able to adjust to that user’s preference. It’s not a team sport for me so I never had a conflict of styles other than converting public code samples to match my way.