News for hackers. Stuff that matters.
Re:A modest proposal by seanwilson on Saturday September 09, 2017 @06:28AM (#15206416)
Yeah...that's frustrating. For a Chrome Extension manifest JSON file I was recently editing, you have to enter a description field that I found out is limited to around 100 characters after a failed upload. I wanted to add a comment above this field so myself and anyone else editing the file was aware of this in the future (a good use of comments in my opinion). I'm not going go through the hassle of a build step to do this. Programming languages allow comments for a reason and I don't see what's so different about JSON.
Re:A modest proposal by DaiPlusPlus on Saturday September 09, 2017 @07:22AM (#15206570)
If the consuming program allows it, you can fake a comment by storing it as a JSON property value:

  { "myComment": "This is a comment!", "realValue": 1 }
Re:A modest proposal by seanwilson on Saturday September 09, 2017 @07:29AM (#15206588)
That's what I did actually. I don't like it though. A comment is really saying "this is a note for the reader that isn't used at runtime". Putting a comment in as a value goes against that and it uses up memory when the file is read in.
Re:A modest proposal by rpdillon on Saturday September 09, 2017 @10:23AM (#15207206)
On the flip side, I've always found it useful when debugging at a REPL to be able to read various kinds of metadata about objects, including documentation. Clojure is one example of this, but I wouldn't mind seeing it elsewhere as well.

https://clojure.org/reference/metadata

Re:A modest proposal by seanwilson on Saturday September 09, 2017 @10:48AM (#15207325)
Hmm, so I'm thinking about cases where you have 10K objects and you wouldn't want the metadata duplicated and attached to all of those. Would that happen in Clojure?