6 ms·
It's true that Douglas Crockford is not my dad. My dad is a different person entirely. It's a bad idea to write JSON parsers that can accept comments. Comments
by MathMonkeyMan 2y ago
It's true that Douglas Crockford is not my dad. My dad is a different person entirely.
It's a bad idea to write JSON parsers that can accept comments. Comments are not part of JSON.
There are plenty of extensions to JSON, and they have parsers. Use them. Or, use a language that is already an extension to JSON, like JavaScript or YAML.
- stoperaticless 2y agoI want to highlight, that extra bad part is keeping the name “json parser”. (Naming it my-custom-format parser would circumvent ambiguity)
- michaelmior 2y ago> It's a bad idea to write JSON parsers that can accept comments. Comments are not part of JSON. I would tend to agree, but I don't think it's such a problem if it requires an option to be enabled and the docs make it clear that incorporating comments means it's not really JSON anymore.