| ▲ | DJBunnies 8 hours ago | |||||||||||||
While I wish JSON formally supported comments, it seems more sensible (compatible) to just nest them inside of a keyed list or object as strings. | ||||||||||||||
| ▲ | Etheryte 7 hours ago | parent | next [-] | |||||||||||||
Works right up until you get an entity where the field `comments` is suddenly relevant and then you need to go change everything everywhere. Much better to use the right tool for the job, if you want JSONC, be explicit and use JSONC. | ||||||||||||||
| ||||||||||||||
| ▲ | ljm 7 hours ago | parent | prev | next [-] | |||||||||||||
Personally, I think if your JSON needs comments then it's probably for config or something the user is expected to edit themselves, and at that point you have better options than plain JSON and adding commentary to the actual payload. If it's purely for machine consumption then I suspect you might be describing a schema and there are also tools for that. | ||||||||||||||
| ▲ | NooneAtAll3 5 hours ago | parent | prev [-] | |||||||||||||
idk... "ans: 42 // an old reference from DA API" seems easier to read than wasting 4 lines of yours multiply that for a long file... it takes a toll --- also sometimes one field contains a lot of separate data (because it's straight up easier to deserialize into a single std::vector and then do stuff) - so you need comments between data points | ||||||||||||||