3 ms·
> It's fashionable to hate XML because it was used in a lot of places it was a bad fit in the 00s, but at least it's a pretty good document language. > YAML th
by earthboundkid 6y ago
> It's fashionable to hate XML because it was used in a lot of places it was a bad fit in the 00s, but at least it's a pretty good document language.
> YAML though is always a bad fit. If you want machine readable config, use JSON; human readable, use TOML. When does YAML ever fit?
https://twitter.com/carlmjohnson/status/1372224080749993988 https://twitter.com/carlmjohnson/status/1372224080749993988
- forgotpwd16 6y agoThe human readable part is a bit subjective. I find YAML more human readable than TOML.
- earthboundkid 6y agoReadable, maybe? I mean as long as the YAML is correctly quoted, sure, it looks fine. But that's a big if. But writeable, hell no. I have been writing YAML for years and still have no idea how the quoting works, and not for lacking of looking it up in the past.
- j1elo 6y agoI never got this stance; JSON sucks for config files, because as a user, if there is anywhere that I need and am more thankful for comments, is in a configuration file. And TOML is maybe a good substitute for INI formats, but it doesn't really support nested data like JSON would, so suggesting to use TOML instead of JSON is misleading except for the simplest and most basic needs. If replacing JSON is the objective, I'd very much rather recommend HJSON [1] than TOML. [1]: https://hjson.github.io/faq.html https://hjson.github.io/faq.html
- mikey_p 6y agoWhat about HOCON? https://github.com/lightbend/config/blob/master/HOCON.md https://github.com/lightbend/config/blob/master/HOCON.md
- j1elo 6y agoI guess why not? I mean, there are lots of options here. I prefer HJSON, also it helps a lot that its website does a very good job at convincing other fellow devs to try it... But there is also JSON5, among the most popular alternatives. Then HOCON you mention, and probably a myriad more.
- dreamer7 6y agoCould your problem be partially resolved by having a key called description or comments where you could provide some clarification?
- outworlder 6y agoBut now that's part of the data and the parser doesn't know any better. Comments are more useful if they are close to the thing being talked about.
- earthboundkid 6y ago> it doesn't really support nested data like JSON would This is just plain wrong. It supports exactly the same kind of nesting as JSON.