News for hackers. Stuff that matters.
Re:Comments in JSON by nonchalance on Friday August 02, 2013 @12:54PM (#6148110)
You can represent annotations (which describe most of your examples) by adding keys:

    {
        "data": "some data",
        "data_comments": "here are my comments"
    }
Re:Comments in JSON by sixbrx on Friday August 02, 2013 @02:00PM (#6148554)
Not transparent to actual clients of the data.

edit for clarity: You're assuming that the application code isn't doing something with each key that it reflectively sees in the object, e.g. creating database fields to match them, or launching missiles towards those destinations, etc.. If you wouldn't automatically add dummy elements to a hashmap or dictionary in Java or Python, then you shouldn't add keys in a javascript object, unless you control the source to the program that will processing the data. Even then you shouldn't, because it will become a habit to add comments this way, and that will bite you when an extra key does matter.

Re:Comments in JSON by dnautics on Friday August 02, 2013 @01:23PM (#6148295)
or just use the key "comment" more than once, which is sort of a hybrid of the ideas.
Re:Comments in JSON by IanCal on Friday August 02, 2013 @01:37PM (#6148395)
Parsers might throw an error on duplicate keys, or launch emacs solving the towers of hanoi.