3 ms·
> lack of support for trailing commas in JSON This, 100%! And the lack of comments.
by reddalo 2y ago
> lack of support for trailing commas in JSON
This, 100%! And the lack of comments.
- Cthulhu_ 2y agoJSON5 allows comments, it's been around since 2012. That said, JSON is not meant for humans / manual editing, and deciding to use it for configuration files was a mistake.
- recursive 2y agoHow am I supposed to make changes to this configuration file?
- macbem 2y agoeven if it wasn't meant for humans and manual editing, it works reasonably well for these usecases
- reddalo 2y agoI'd say it even works better than many common configuration filetypes such as YAML or INI.
- wruza 2y agoThinking that a new, least sucking data format won’t be used for configuration was a bigger mistake. Like, yeah, I will exchange all my data in JSON now, but store configs in a good old XMLNS XSLT DTMF?
- Olreich 2y agoStore configs in the program if you can. Store in INI, TOML, or something similarly simple for humans if you must. Never use anything that requires matching syntax as the default (closing tags and matched brackets being the two main ones). JSON is already strictly worse than XML though as it doesn’t support comments and multi-line strings in a sane way.
- wruza 2y agoThanks, but I tend to ignore this. Every time you, as a direct end-user, provide feedback on format or software, someone appears with a whole philosophy around why you shouldn't be like that and what you should do instead. And sometimes there's no "why" part even. But I really don't need philosophy. I know what I want, and I want json with $subj, //comments and optional key quoting. Feels like some people just love making inconvenient things standard and/or teaching others how to live. (I mean the idea "json is not for X" here, not your comment)