3 ms·
> A new format is a really weird way to go about fixing a problem that already has a solution. Stripping comments before handing off to a JSON parser is not a
by willtim 6y ago
> A new format is a really weird way to go about fixing a problem that already has a solution.
Stripping comments before handing off to a JSON parser is not a full solution. For example, if the file has to be augmented with additional data and written out again, the comments would be lost.
- wruza 6y agoFormatting would be lost too (multiple newlines, array formatting, wrap limits, etc), and the order of keys. There are two separate tasks: comment json for a human and ignore that on parse(), and maintain pretty-json with all its usefulness programmatically with parseWithSyntaxStructure(). We shouldn’t mix them into one single problem, because in one case you just want multiple readers (a human and a computer) and in the other you want to rich-edit a human representation on its own.