Hacker News new | ask | show | jobs
by kryptiskt 1408 days ago
The first two sentences of the text on http://json.org are "JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write."

It's a primary goal of JSON, it's fair to question whether it's successful at it. Personally, I'd much rather write TOML or S expressions. I don't like YAML at all, the whitespace sensitivity drives me nuts.

2 comments

Douglas Crockford usually says he discovered JSON, and subsequently named it and wrote a specification, and I think this precludes suggesting it had design goals, because it wasn't an invention. More broadly, I also think this understanding of JSON's origins absolves the discoverers of its limitations, and opens the door to talking about improvements and variations.

Notwithstanding which, I too would prefer to interchange data via S-expressions.

He made changes that were based on design goals. He simplified a few parts, and removed comments with the explicitly stated goal of avoiding parsing directives.

We can say the underlying idea of taking javascript's object syntax was a discovery, but he refined it between discovery and release.

This seems to merely be applying Saint-Exupéry's rule as an editor, which is a matter of baseline competence, and hardly seems worthy of description as a goal of any sort.
I don't follow your discovery/goal-less-ness argument. Why couldn't one of the things present in his discovery be readability?

+1 on those S-expressions.

Early versions of JSON supported // comments. As Crockford tells the story, they were removed because folks were using them for pragma, leading to interoperability issues, and because several parser authors working in languages other than Javascript reported surprising levels of complexity when implementing comments.

My point being; aspects that seem like irritating omissions now, may have been editing decisions instrumental in the overall adoption of the standard.

I don't get how anyone uses TOML. YAML is whitespace sensitive but it's python rules and quite sensible.

TOML is just plain unreadable to me when I have to figure out what I'm looking at: I convert it to YAML to both read and write it when I have to add new lists/maps.

You are not alone, I find TOML awful to use and hate when I get forced into it.

Give me YAML or JSON at least they make sense.