3 ms·
Isn't that a great example of something that would benefit from comments; a generically named int array with no context? Regarding the ability to add comments
by wewtyflakes 4y ago
Isn't that a great example of something that would benefit from comments; a generically named int array with no context?
Regarding the ability to add comments to JSON, it can be done in a cumbersome manner, such as adding a field to an object called "comment", but it is a hack since this wont work for arrays anyway.
- avmich 4y agoThe point is that JSON is a data structure, comment is rather unnatural there. It can be added to JSON though, just like an array could be wrapped in an object with a "comment" field. Usually array name serves as a crude comment. Literate programming isn't very popular.
- wewtyflakes 4y agoThis does not help if you are integrating against someone else's API.
- dragonwriter 4y ago> The point is that JSON is a data structure JSON is not a data structure. JSON is a data language. A computer program is a data structure and doesn't need comments, a programming language is a format for a human to read, write, and interact with automated tooling, whoss content is a program, but for the human uses, comments are important. Similarly for data languages.