4 ms·
> * Avoid YAML as much as possible, period. Why does YAML have any traction when JSON is right there? I'm an idiot amateur and even I learned this lesson; my 1
by philistine 2y ago
> * Avoid YAML as much as possible, period.
Why does YAML have any traction when JSON is right there? I'm an idiot amateur and even I learned this lesson; my 1 MB YAML file full of data took 15 seconds to parse each time. I quickly learned to use JSON instead, takes half a second.
- sofixa 2y agoBecause YAML, as much as it sucks, is relatively straightforward to write by humans. It sucks to read and parse, you can make tons of small mistakes that screw it up entirely, but it's still less cruft than tons of needless "": { } . For short configs, YAML is acceptable-ish. For anything longer I'd take TOML or something else.
- 12_throw_away 2y ago> Why does YAML have any traction when JSON is right there? Because it has comments, which are utterly essential for anything used as a human readable/writable configuration file format (your use case, with 1 MB of data, needs a data interchange format, for which yes JSON is at least much better than YAML).
- fireflash38 2y agoJSON is valid YAML. YAML has comments. YAML is easily & trivially written by humans. JSON is easily & trivially written by code. My lesson learned here? When generating YAML, instead generate JSON. If it's meant to be read and updated by humans, use something that can communicate to the humans (comments). And don't use YAML as a data interchange format.