4 ms·
I 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 configurati
by j1elo 6y ago
I 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.