3 ms·
I don't get it. Even if filenames were displayed in uppercase back then, there's no reason to do so now. It's like how people write SQL with uppercase keywords
by kqr 3y ago
I don't get it. Even if filenames were displayed in uppercase back then, there's no reason to do so now.
It's like how people write SQL with uppercase keywords, but not any other language. I suppose it's learning by emulation and then old habits die hard.
- Dalewyn 3y agoReadability. Pardon the breach of rules for a moment: IT'S EASIER TO READ THIS THAN it's easier to read this.
- kqr 3y agoExcept it's not! If it is, you need to make text much bigger. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2016788/ https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2016788/ If readability of lower-case was the issue we would write all variable and function names in upper case, even in languages that have lower-case keywords.
- skipkey 3y agoThe important thing is, the style needs to be consistent over the whole codebase. If most of the SQL has uppercase keywords, a small portion that does not will be harder to read. I dislike the PEP8 style for python, but I use it anyways, mostly.
- lproven 3y agoRemember that this stuff was designed in the era when dumb terminals and early PCs had text-only displays which were incapable of showing more than one character size or one colour. Secondly, upper-casing some parts is not about global readability; it's about contrasting code on monochrome displays. The PARTS IN CAPITALS are the parts the language (compiler or whatever) defines and must have spelled exactly that way. The parts in lowercase are the names, symbols etc. that the programmer defines rather than the compiler or OS. Personally that is how I learned and even now, some 40 years later, I find that C-style everything in lower case is MUCH less readable for me than mixed CAPS and minuscule.
- kqr 3y agoI get why they did it back then (when only uppercase is available, of course you'll use uppercase). I also get why it's something people learn by imitation and then never question. I'm just wondering what the utility is today for people who have questioned it but decided to go with uppercase for parts of the code anyway. As someone else said, if one is prone to confusing keywords with identifiers, syntax highlighting has existed for many years now, and solves that problem MORE elegantly than INTERSPERSING a few SHOUTED words in the CODE.
- lproven 3y agoWhy should my personal preferences change just because technological trends change? I am not a programmer, but in the last decade I worked for 2 of the biggest Linux vendors writing documentation in DocBook XML. Both companies followed the "docs as code" approach so we used programmers' editors, programmers' version control systems, etc. I don't really want multicoloured code. I find that visually intrusive. I prefer fewer colours in my UI, not more. I find editors that indicate syntax with colour to be loud, irritating, and annoying. I find the simple traditional look of black on white, as humans have been using for text for millennia, and capitals for keywords and minuscule for the human-written parts, easier on the eyes and brain. I am not telling you that you should use it. I am not telling you that your preferences are wrong. I am just telling you that yours don't match mine and I prefer mine. You seem to feel that my preferences are wrong and I am wrong and want to tell me that.
- kazinator 3y agoIf your preference were applied to typography, books would look like this: IT WAS A dark AND stormy night; THE rain fell IN torrents, except AT occasional intervals, WHEN IT WAS checked BY A violent gust OF wind WHICH swept UP THE streets (FOR IT IS IN London THAT OUR scene lies), rattling along THE house-tops, AND fiercely agitating THE scanty flame OF THE lamps that struggled AGAINST THE darkness. THROUGH one OF THE obscurest quarters OF London, AND among haunts little loved BY THE gentlemen OF THE police, A man, evidently OF THE lowest orders, WAS wending HIS solitary way. HE stopped twice OR thrice AT different shops AND houses OF A description correspondent WITH THE appearance OF THE quartier IN WHICH THEY WERE situated, AND tended inquiry FOR SOME article OR ANOTHER WHICH DID NOT seem easily TO BE met WITH. (The verbs be and do get capitalized in all their conjugations, because they have special roles in the grammar, making them keywords.) If typography for prose were like this, people would be used to reading it, and more code in more programming languages would look like that. The on the other hand, people have experimented with syntax coloring for parts of speech. That actually looks quite bad and detracts from readability; yet lots of coding is done that way. Code is laid out in certain two dimensional ways that prose is not, and the keywords that get emphasized (whether through CAPS or color or both) occur in certain predictable visual structures rather than as soup ingredients in a wall of text. Formatting of and typography of prose are not absolutely linked.
- o11c 3y agoI've seen "lowercase is easier to read" much more often, though I lack sources either way. Intuitively it does seem that a meaningful contour on top would make mental processing easier. Lowercase letters requiring descenders (g, j, p, q, y) might be relevant.
- hnbad 3y agoIt's a bit more complicated than "X is easier to read than Y". When we read text, we don't read letters, we read words. So familiar word shapes help reading text more quickly. Lowercase letters have more distinct shapes (due to ascenders and descenders) so they make for more distinct word shapes. Uppercase word shapes are not only less familiar (because most text you've read is not all-caps) but also less distinct because they lack descenders and all have roughly the same height. So in other words, writing keywords as in SQL in uppercase can be more readable because a) it indicates it's that language (which can be helpful in mixed-language source code), b) the keywords usually being written in uppercase make them easier to recognize without having to be familiar with the words from other contexts (this might actually be an advantage for people who don't read as much English text) and c) this sets keywords apart from variable and attribute names without syntax highlighting. For filenames and such there is no such advantage which is why you only occasionally see all-caps used for special files (e.g. LOCK, VERSION, README) where the uppercase text is intended to stand out from other file names and usually follows a naming convention that makes the word shape common enough to be easy to recognize.
- tomashubelbauer 3y agoThere was a story some years back about some countries changing traffic signs to normal case instead of upper case because with upper case you lose the ability to pattern match words so it is actually harder to read at glance. I found a few links but I am not sure which one is the most canonical one, my memory of this is rather hazy, so I haven't linked any articles.
- hyperman1 3y agoI've gone to uppercase. SQL is a noisy language, with lots of keywords cluttering up your code. I write the keywords in uppercase, and the table and column names in camel case. It seems to make the usefull stuff easyer to find, and the camel case gives a bit of extra info where it matters.
- tomthehero 3y agoTrue. This is exactly why I do it too. I wish SQL was less like English and more like a computer language.
- kqr 3y agoOh, that does make some sense. So basically in languages like Python, Lisp and Lua you would use uppercase for identifiers like variable names to separate them from keywords and builtins, whereas in languages like Perl and C you would not, because the syntax is designed to highlight keywords through punctuation anyway?
- kazinator 3y agoLisp is not a language, but a language family. You might be thinking of some case-sensitive member of the family. Common Lisp is case-folding to upper case by default so DEFUN and defun are the same; both tokens denote a symbol whose name is the character string "DEFUN". Symbol names themselves are sensitive; "DEFUN", "Defun" and "defun" are all different character strings and different symbol names. (find-symbol "defun") will not find the defun symbol. In Common Lisp, you can carry on the sane coding convention as described by the grandparent comment, whereby built-ins like DEFUN and LET are written in upper case, and your own identifiers are mixed case.
- hyperman1 3y agoGood question. I think the answer is no -- I never promised consistency ;-) For Python, I'd follow PEP8 [1], as it is more important to follow the local programming culture, even if it has some warts. Otherwise, programs from multiple people would quickly become messy, and learning and code reuse between projects becomes harder. I didn't do much lisp, but considered the builtins as library functions I theoretically could have written myself. So they were lower case, as coherent with all other names of functions etc... Can't comment on Lua, I've done <100 lines of it and forgot basically all of it. I used to write BASIC keywords in upper case and vars lowercase (GOTO longlongago) Tradeoffs, tradeoffs, tradeoffs, as always. I presume SQL has not much consistency in formatting and casing, so I grew my own convention. [1] https://peps.python.org/pep-0008/#prescriptive-naming-conventions https://peps.python.org/pep-0008/#prescriptive-naming-conven...
- thaumasiotes 3y ago> It's like how people write SQL with uppercase keywords, but not any other language. People have syntax coloring in other languages.
- yau8edq12i 3y agoI have syntax coloring in SQL too. You should try it.
- TonyTrapp 3y agoFun fact: "Back then", in Windows 98, 8.3 filenames were shown in Explorer with only the first letter capitalized, and the rest in lower-case. So people were already annoyed by all the SHOUTING back then. But on NT-based systems this was no the case, so going from 98 to XP took some getting used-to in that particular case.