On Mon, 30 Nov 2015 20:42:20 +0000, Jack Stouffer wrote: > JSON5 is also just a terrible idea. There is a very good reason why JSON > does not have comments > https://plus.google.com/+DouglasCrockfordEsq/posts/RK8qyGVaGSr and why > it's strict. Data formats should have data, not anything else.
I fully understand and sympathize with desires for simple formats for data generated by a program to be read by a program. JSON is just fine for REST interfaces. It's great as a storage format for document databases. I'm not advocating for JSON5 there. But JSON is also used for human-edited configuration files. Configuration files should allow for comments. I poke about /etc and see that nearly every file there has copious comments detailing which fields exist, what sorts of values are allowed, the effects that field has, what the default values are, and whether you need to coordinate values between them. I've probably used those comments several hundred times, and I'd spend many hours paging through Google and asking questions on stackoverflow if they didn't exist. JSON forbids comments, which is less than ideal. But Ruby's JSON parser allows comments, as does Newtonsoft JSON.NET. If a human is going to edit a document, it should ideally be easy to edit it. It would be friendly, for instance, to allow trailing commas, because that's one less thing that a human has to worry about. Java's org.json library, which is linked from and has its documentation hosted at json.org, allows trailing commas. Newtonsoft JSON.NET does likewise. It would be friendlier to the fingers to be able to omit quotes on simple object keys since it's less typing and no less clarity. Many strings contain double quotes, so it would be nice to allow single-quoted strings. org.json allows single-quoted strings. JSON.NET allows unquoted object keys and single-quoted strings.
