3 ms·
And for a data interchange format this is also 100% reasonable. The problem is that people have started using JSON for configuration files and the like, which
by arp242 4y ago
And for a data interchange format this is also 100% reasonable.
The problem is that people have started using JSON for configuration files and the like, which IMHO has always been – and continues to be – the wrong tool for the job.
- hgsgm 4y agoHow does that relate? Your config parser can disregard commments.
- arp242 4y agoYes, but JSON was never intended for that use case – the feature set isn't geared towards it.
- mikepurvis 4y agoI think the point is that your config parser should be using yaml or toml, though in fairness neither of those existed in the early 2000s when JSON was being developed/discovered/adopted— the 800lb gorilla in that space at the time was XML. And XML remained dominant for a long time— for example, the original Google Maps from 2005 received its server responses as XML blobs, and API v2 even exposed the relevant parsing functionality as the GXml JavaScript class. By around 2007, it was all JSONp I think, and GXml was deprecated and removed in API v3 and v4 respectively.
- deepsun 4y agoWhat comments? JSON doesn't have any. And editor will rightfully mark them as errors.
- anentropic 4y agothat's the JSON5 support
- deepsun 4y agoThat's my point. Parent says that config parser can disregard comments. Why would it need to disregard comments if it was json5?