The #1 place I've seen comments in JSON are where someone makes the mistake of using JSON for a configuration file format. The lack of support for comments is ironically why even XML is a better choice for that. Regardless, you can understand why people would want comments there outside of just dev environments.
(I just learned as of two hours ago that YAML can be used with JSON syntax so I guess it's academic, just use YAML...)
I have done exactly that :( Now I know YAML can be written like JSON though I'm probably going to just switch to that in future as YAML has almost as much support as JSON. I'd only been avoiding it because I thought the indenting-is-meaningful syntax was mandatory.
View all comments
Show parent comment
15
u/Turbulent_Stick1445 4d ago
This is what I do, but there are two problems with it:
It gets ugly fast.