Hacker News new | ask | show | jobs
by rbut 1723 days ago
Because:

  ‘I am “really” angry’
Is much nicer than:

  “I am \”really\” angry”
2 comments

and now you have two problems

is this any better?

    'I\'m "really" angry, don\'t do it again!'
in many languages single quotes are used as apostrophes and are very very common, much more common than double quotes.
Nobody's forcing you to use single quotes as delimiters.

"I'm \"really\" angry, don't do it again!"

Json is not meant to be human readable or writeable.
All text based data formats are meant to be human readable and human writable, and humans read and write JSON all the time.
You wouldn't say that mammals write C all the time, would you? Front end development would be so much better if you could just spew json at people in a table.
>You wouldn't say that mammals write C all the time, would you?

Yes. Mammals do write C all the time, because humans are mammals. And C is meant to be human readable and writable.

> Front end development would be so much better if you could just spew json at people in a table.

That's literally what a JSON API is, and there are tons of them. And for each of them, a human had to be able to read and comprehend JSON responses and write JSON requests in code. There's a reason JSON is pretty-printed in the debug consoles of browsers.

To say nothing of all of the package definitions or framework configs that are written (by hand) in JSON.

The fact that most JSON is machine generated at present has nothing to do with its original design intent. Most Javascript, CSS and HTML are machine generated nowadays as well, but they were meant to be written by a person using a text editor.

I've worked on 4+ years of technology that was entirely based on humans hand-tweaking, editing, and updating JSON configs. My text editors validate it quickly, and know how to fold, sort, prettify. Based on my experience (and editing it all day long) It's a very human readable and editable configuration.
Second sentence from json.org: "It is easy for humans to read and write."
But JSON5 is.