News for hackers. Stuff that matters.
Re:JSON5 – JSON for Humans by arp242 on Monday December 09, 2024 @08:49AM (#42366259)
The thing is that JSON was intended to be a data exchange format, not a configuration file format or anything else. IMHO Crockford's reasoning makes a lot more sense with that in mind.
Re:JSON5 – JSON for Humans by layer8 on Monday December 09, 2024 @10:32AM (#42367116)
XML was intended as a data exchange format and has comments. Image file formats like JPEG and PNG support comments (and so does SVG by virtue of being XML). Database systems support comments on database objects. It’s really not a convincing argument.
Re:JSON5 – JSON for Humans by gregoriol on Monday December 09, 2024 @09:08AM (#42366372)
Even if we stick to the data exchange format, it would be practical to have comments in examples of data. This would be good for training and learning, for documentation.
Re:JSON5 – JSON for Humans by arp242 on Monday December 09, 2024 @09:59AM (#42366779)
Obviously it's useful in many cases; designing anything like this is an exercise in trade-offs.
Re:JSON5 – JSON for Humans by conscion on Saturday December 14, 2024 @07:43PM (#42420579)
This is still possible. There's nothing stopping you from putting comments in the JSON in your file or a webpage. It's just not going to be accepted as valid by JSON parser, which for learning material should be fine.
Re:JSON5 – JSON for Humans by JambalayaJimbo on Monday December 09, 2024 @08:58AM (#42366316)
Data interchange formats are often used for configuration. It makes sense to have a single source of truth in json if your configuration is consumed by an app.
Re:JSON5 – JSON for Humans by hn_throwaway_99 on Monday December 09, 2024 @02:15PM (#42369438)
JSON is a human-readable data exchange format. There is a good reason human-readable data exchange formats are so popular - they can be read and understood by humans! So it seems pretty absurd that a format designed to be read by humans doesn't support comments. If you're really concerned about performance or size, you should use a more efficient binary format for data exchange like protobufs, or heck, BSON (binary json)!