News for hackers. Stuff that matters.
Re:FracturedJson by damnitbuilds on Friday January 02, 2026 @08:00AM (#46464322)
Nice.

And BTW, thanks for supporting comments - the reason given for keeping comments out of standard Json is silly ( "they would be used for parsing directives" ).

Re:FracturedJson by hyperhello on Friday January 02, 2026 @08:14AM (#46464405)
Agreed: this is a very cool library. I once experimented with overriding .toString() to produce nicer arrays and objects by default and it was really helpful for debugging.

But (no offense (in writing) to your opinion (such as it (the opinion ( "they would be used for parsing directives" (straw man) )) is)) that (the reason)'s not (entirely) a silly (in the sense of unnecessary) reason (because it makes things hard to read to have inline directives).

Re:FracturedJson by Xymist on Friday January 02, 2026 @08:31AM (#46464551)
It's a pretty sensible policy, really. Corollary to Hyrum's Law - do not permit your API to have any behaviours, useful or otherwise, which someone might depend on but which aren't part of your design goals. For programmers in particular, who are sodding munchkins and cannot be trusted not to do something clever but unintended just because it solves a problem for them, that means aggressively hamstringing everything.

A flathead screwdriver should bend like rubber if someone tries to use it as a prybar.

Re:FracturedJson by mystifyingpoi on Friday January 02, 2026 @09:22AM (#46465002)
> A flathead screwdriver should bend like rubber if someone tries to use it as a prybar.

While I admire his design goals, people will just work around it in a pinch by adding a "comment" or "_comment" or "_comment_${random_uuid}", simply because they want to do the job they need.

If your screwdriver bends like a rubber when prying, damn it, I'll just put a screw next to it, so it thinks it is used for driving screws and thus behaves correctly.

Re:FracturedJson by pixl97 on Friday January 02, 2026 @10:34AM (#46465750)
And we wonder why people are calling for licensed professional software engineers.
Re:FracturedJson by nodja on Friday January 02, 2026 @09:15AM (#46464932)
On one hand, it has made json more ubiquitous due to it's frozen state. On another hand, it forces everyone to move to something else and fragments progress. It would be much easier for people to move to json 2.0 rather than having hundreds of json + x standards. Everyone is just reinventing json with their own little twist that I feel sad that we haven't standardized to a single solution that doesn't go super crazy like xml.

I don't disagree with the choice, but seeing how things turned out I can't just help but look at the greener grass on the other side.

Re:FracturedJson by libria on Friday January 02, 2026 @09:21AM (#46464987)
> A flathead screwdriver should bend like rubber if someone tries to use it as a prybar.

Better not let me near your JSON files then. I pound in wall anchors with the bottom of my drill if my hammer is not within arms reach.

Re:FracturedJson by speed_spread on Friday January 02, 2026 @10:04AM (#46465430)
JSON is used as config files and static resources all the time. These type of files really need comments. Preventing comments in JSON is punishing the wide majority to prevent a small minority from doing something stupid. But stupid gonna stupid, it's just condescending from Mister JSON to think he can do anything about it.
Re:FracturedJson by damnitbuilds on Saturday January 03, 2026 @12:44PM (#46479398)
"do not permit your API to have any behaviours, useful or otherwise, which someone might depend on but which aren't part of your design goals"

I can not follow this law by making my API depend, say, the contents of a string value. Preventing APIs depending on the value of a comment is no different, so your argument is not a reason for not having comments.

Re:FracturedJson by patates on Friday January 02, 2026 @08:32AM (#46464555)
XML people were doing crazy things in the Java/.NET world and "<!--[if IE 6]>" was still a thing in HTML when JSON was being designed.

I also would have wanted comments, but I see why Crockford must have been skeptical. He just didn't want JSON to be the next XML.

Re:FracturedJson by frizlab on Friday January 02, 2026 @08:40AM (#46464624)
Unrelated: why spaces inside the parentheses? It’s not the first time I see this, but this is incorrect!
Re:FracturedJson by cromulent on Friday January 02, 2026 @09:37AM (#46465155)
JSON doesn't have parentheses, but it does have braces and brackets. The JSON spec specifically allows spaces.

> Insignificant whitespace is allowed before or after any token.

Re:FracturedJson by frizlab on Friday January 02, 2026 @09:45AM (#46465235)
I was talking about the parent comment, which has spaces inside the parenthesis (I do prefer no spaces inside brackets and braces in my JSONs, but that’s another story).
Re:FracturedJson by Sohcahtoa82 on Friday January 02, 2026 @02:02PM (#46468135)
Probably someone who writes C/C++ and formats their code that way

    if ( x == ( y + z ) * w ) {
Personally, I find it hard to read.
Re:FracturedJson by damnitbuilds on Saturday January 03, 2026 @05:26AM (#46474978)
Agreed. But I find this easier to read:

  if ( x == (y+z) * w )
      {
Spaces help group things.