4 ms·
Readability matters and humans like that. Otherwise XML would have won. https://guidetogrammar.org/grammar/twain.htm https://guidetogrammar.org/grammar/twain.h
by smackeyacky 2y ago
Readability matters and humans like that. Otherwise XML would have won.
https://guidetogrammar.org/grammar/twain.htm https://guidetogrammar.org/grammar/twain.htm
- jeroenhd 2y agoI don't find commas at the end of line adding any more readability than avoiding them, except for the oneliner counter case. JavaScript has optional separators (semicolons) with some rules to avoid ambiguity. Not everyone like it (I use semicolons in JS unnecessarily because I can't be bothered to learn the three edge cases they're not optional). I think there's something to be said for "commas are optional except in oneliners". Languages like Go describe structs without commas. It took me some getting used to, but it's really not more or less readable in my opinion.
- gregopet 2y agoIf readability was the only criteria perhaps YAML deserves to win. For some data XML is more readable, its complexity is the bigger problem. People went all in with things like XSLT and namespaces, Java became the "language that transforms XML into stack traces" for no good reason and complex XML monstrosities were considered normal so when something simple came along it was a much needed breath of fresh air (we were even prepared to overlook its lack of comments). If it wasn't JSON it would have been something else, I'm sure.
- smackeyacky 2y agoWe are trained from a very young age, as a rule, to see the comma. The semicolon, not so much. Semicolons are unusual: they are not part of story telling; they are from a forgotten grammar which is hardly used.
- card_zero 2y agoPooh had wandered into the Hundred Acre Wood, and was standing in front of what had once been Owl's House. It didn't look at all like a house now; it looked like a tree which had been blown down; and as soon as a house looks like that, it is time you tried to find another one. What do you mean, not part of story telling? There are 64 semicolons in The House at Pooh Corner; and by the way, nearly all of them are followed by conjunctions.
- geor9e 2y agoI get the argument, but I can't imagine a double-blind study of children or adults of any age that would find they see a semicolon versus a comma at a different rate. If anything, the reverse argument works; the semicolon is more obvious because it's so unusual.
- Timon3 2y agoYAML seems easier to read, but for me it's much harder to actually read properly since so many things are ambiguous. JSON is very explicit - you always know the data type you're looking at. YAML has a bunch of special cases that you have to remember, and these frequently lead to bugs. The best example are boolean values. With JSON, you have `true` or `false`. With YAML you have all of these: y|Y|yes|Yes|YES|n|N|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF