4 ms·
1. "YAML is stupid" is not constructive. Why is it "stupid"? 2. One place where YAML is nice is if you want to have a user-edited file. JSON can be a pain to e
by dagenix 8y ago
1. "YAML is stupid" is not constructive. Why is it "stupid"?
2. One place where YAML is nice is if you want to have a user-edited file. JSON can be a pain to edit by hand due to a lack of comments and being so picky about where commas can and cannot go - YAML isn't perfect, but, it does help with issues like that.
3. There are languages outside of Javascript, and it's not possible to import a javascript file directly from most of those languages.
4. There is a difference between the file that you use to configure an app - for which JSON or YAML may be a good fit - and the format for which you export data - where JSON or YAML may or may not be a good fit.
5. JSON has some very real issues with different parsers not implementing the JSON corner cases the same way - which doesn't really matter, until you hit one of those cases and then it really matters.
6. JSON doesn't support streaming access to file data - it's not impossible to process a JSON file incrementally, but, it's hard to do as JSON is easiest used when you can load the whole thing into memory.
- crooked-v 8y agoTo me, the biggest problem with YAML is how much unintuitive magic behavior it has with translating values into different types (see unquoted yes/on actually evaluating as boolean true), which makes its increased direct-editability actually a bad thing.
- hliyan 8y agoI've been trying to decipher this irrational hatred of YAML coming from a certain subset of developer for years. I've only three or four data points so far, but all of them were very gifted, opinionated developers who were unable to explain their hatred. Recently, it began to dawn on me that maybe the problem is one of visual acuity required for discerning whitespaces. I always assumed that just because I could visualize a YAML hierarchy just as well as I could JSON, and could edit YAML without messing up the indentation, that others could too. But I've witnessed highly capable developers bang their heads against the keyboard trying to fix repeated parsing errors in YAML they've written. Perhaps not everyone can pick up whitespaces quite so easily...
- ojosilva 8y agoMy experience failing with YAML: I've converted a visual workflow tool into a YAML file mode so I could give my users a file format they could edit, share and version with any text editor and commit to a git repo. The result was that they were at a loss trying to figure out the free-form map and array structures. They could not grasp when to use dashes (arrays) mixed with maps (array of maps) and would fail to indent structures all the time. Trying to create meaningful error reporting was very hard since their mistakes were also valid YAML. YAML is definitely powerful but can become too complex too fast. And being a format full of sigils and its TIMTOWTDI "there's more than a way to do it" approach can easily enrage lean purists and complexity detractors, hence the hatred.
- revskill 8y agoOK. Let me clarify. YAML couldn't be imported directly by , for example, Javascript. You have to readFileSync, parse it, process it some way. YAML whitespaces are hard to get right. You have to have consistent indent format for both editor and the yaml file itself. YAML couldn't be composed. YAML's types are confusing with quotes and not quotes.