19 ms·
JSON is meant to be a serialization language, not a config file language. Therefore it strips out all the things that it doesn't need. If you want a config file
by FooBarWidget 15y ago
JSON is meant to be a serialization language, not a config file language. Therefore it strips out all the things that it doesn't need. If you want a config file language then use YAML which is a much better candidate.
- amalcon 15y agoYes, YAML is very nice. Importantly, it reduces to key:value for the 90% of config files that don't require any hierarchy while still allowing hierarchy if you need it. I'm not sure I buy the serialization argument, though: it's a human-readable serialization format. One of the big advantages of human-readable formats is that you can craft data objects by hand (for automated tests, initial bootstrapping, etc). Comments are very helpful for those situations.
- JonnieCache 15y agoIt also has inheritance-like features that make it really suited to config files. JSON really isn't a good idea for config files when we have YAML.