4 ms·
JSON lacks comments and will fail for a missing or extra comma, so it's not great for configuration written by humans. You can use HJSON which is the json with
by user5994461 6y ago
JSON lacks comments and will fail for a missing or extra comma, so it's not great for configuration written by humans.
You can use HJSON which is the json with comments. It's fully compatible with json so easy to introduce into anything that does json. https://hjson.github.io/ https://hjson.github.io/
- gsliepen 6y agoFailing with an extra comma also makes it harder than necessary to write JSON by machines.
- dzhiurgis 6y agoI'd rather take "extra comma" failure than "extra space" space failure. First one can be caught by any IDE, second one will take you a couple of minutes to find out (when building CI for example).
- westurner 6y agoJSON5 also supports comments and multiline strings with `\`-escaped newlines: https://json5.org/ https://json5.org/ Triple-quoted multiline strings like HJSON would be great, too.