4 ms·
For what it's worth, yaml is JSON that allows comments (and a bunch of other syntax).
by neallindsay 2y ago
For what it's worth, yaml is JSON that allows comments (and a bunch of other syntax).
- recursive 2y agoAnd ambiguity. It's too far in the other direction IMO.
- loevborg 2y agoTell that to the Norwegians!
- neallindsay 2y agono
- jbaber 2y agoTOML is one-to-one with JSON, except allow comments. I like JSON lines format where I can strip comment lines out.
- selectnull 2y agoJust say no to yaml
- teekert 2y agoI like yaml, easily readable by computers as well as humans (without any coding experience even). I don’t see the problem with it.
- davexunit 2y ago> easily readable by computers Have you ever written or tried to write a YAML parser?
- teytra 2y agoIt's already done, so no need.
- teekert 2y agoI will forever be aware of the pain of the developers of pyaml whenever I `import yaml` from now on. And even more grateful too.
- davexunit 2y agoIt's actually not easy for computers to read YAML. It's very difficult, especially when compared to JSON.
- teekert 2y agoMy computer has little problems with it! Ok, we're being pedantic, perhaps it depends on how much information you put in a Yaml file, I usually see it used for small config files.
- p1necone 2y agoAnd is so pedantic about whitespace that you need to specifically configure your editor to be able to retain your sanity while editing it, no thanks.
- dorfsmay 2y agoyaml is a superset of JSON, which means that any parser that expect yaml will happily consume JSON! Also JSON + comment that's JSON5.
- r3trohack3r 2y agoI used to do this frequently. Take a JSON file, add comments, and parse it as YAML. Then I discovered a handful of YAML parsers in various languages support code execution on parsing. Which basically killed YAML for me.
- neallindsay 2y agoIt's definitely no good for JSON that you don't write yourself. But that's not the JSON that you want to write comments into.
- kstrauser 2y agoI appreciate that Python makes you choose between a “full” parser and a safe one.
- jgalt212 2y agoAt least in Python, YAML parsers are orders of magnitude slower than JSON parsers.
- nasmorn 2y agoI switched out my app config to YAML which parses much slower and now my app starts exactly as fast as before. I don’t think anyone proposes switching to YAML for your API endpoints
- tengbretson 2y agoUsing YAML will make you a more spiritually advanced being because every time you copy and paste content into a yaml document it requires a prayer.
- Group_B 2y agoI want to blow my brains out every time there is a mysterious tab indent in my file