3 ms·
For comments in plain JSON a common approach is to use keys like "comments" or "description" in object literals. As for trailing comma the only real issue in
by fpoling 6y ago
For comments in plain JSON a common approach is to use keys like "comments" or "description" in object literals.
As for trailing comma the only real issue in practice is noisy unified diff output. But for JSON word diff or similar works better in any case when the trailing comma is not an issue.
- mschuetz 6y agoAdding a property to an object that does not belong to the object is pretty much the worst workaround to comments, in addition to it being much harder to read due to lack of comment specific syntax highlighting.
- majkinetor 6y agoThat is not only issue in practice. I can't count the number of times when somebody changed the json adding single line thinking what could go wrong without test...