4 ms·
I'm annoyed when a text format doesn't support comments. Especially a Human one :) Sometimes you want to comment a section out of a JSON without deleting it. O
by 21 9y ago
I'm annoyed when a text format doesn't support comments. Especially a Human one :)
Sometimes you want to comment a section out of a JSON without deleting it. Other times you want to annotate some generated JSON.
And because this is a common need, you have ad-hoc unofficial solutions which are not supported by all parsers.
- taeric 9y agoIn the book Programming Pearls, one of the sections is on "provenance". One of the tips shared was someone that put at the header of every generated file, the command that was used to generate it. I absolutely love the idea and have wanted to do it in places I generate files before. JSON completely kills this, though. I don't want to encode the bloody command, just put a little comment "this file generated on DATE by COMMAND". Grr...
- alecthomas 9y agoIronically, that is exactly why JSON doesn't have comments: https://plus.google.com/+DouglasCrockfordEsq/posts/RK8qyGVaGSr https://plus.google.com/+DouglasCrockfordEsq/posts/RK8qyGVaG...
- taeric 9y agoStrictly, that is different. He was against parser directives. And offered a solution for the case I gave. Quite frankly, I think this is an area he made the wrong choice on. Which is fine, but still annoying. Like checked exceptions. Logic for the choice was sound, if misguided. End result sucks.
- greggirwin 9y agoI agree. I was sad to see comment support removed from the JSON spec.