B) Somebody's gotta write those serialization libraries, and they probably do a fair amount of string manipulation to do so.
C) You can't .join data streams without buffering, which defeats the purpose.
D) Adding commas on a preceding line every time you add a new item to a list can pollute diffs.
E) Trailing commas are syntactically correct in ECMAScript 6, and supported by a fair few other languages.
> JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write.
Sure, it's easy to read and write by humans, because it's simple, but that's not what it is for (which is what I was disagreeing with). Humans communicate better using a natural language, not JSON, as evidenced by the fact that both our comments are in English, not JSON.
And 'easy' is relative anyway. Some of my users have to write JSON (they're not developers). It would be much easier for them if the UI had built the JSON for them, while they click on buttons.
I should like to visit that world one day.
Why JSON at all if you don't care about reading it?
I'm not against Protobuf, BSON, SPDY and the likes, my argument is just that JSON is used over binary formats only because it's readable.
... The irony of yaml being human and version control friendly but including massive amounts of serialization mechanism vs. json being for data exchange and having extremely rudimentary serialization features aside.
It is, however, wrong to say it's terrible because of laziness.
Honest question: Such as?
Prototypical inheritance may have gotten much more exposure via JS, but I'm not overly impressed with it, and I hardly think it makes up for the rest of the language.
I still don't get around how `this` can be so broken.
In which language can't you do array.join(",")? You can even do that in Java with one of the myriad of string libraries. I haven't hand-coded joins since (at least) six or seven years.
ObjectLiteral :
{ }
{ PropertyNameAndValueList }
whereas ES5's is: ObjectLiteral :
{ }
{ PropertyNameAndValueList }
{ PropertyNameAndValueList , }
And while JSON is strongly inspired by javascript's object notation, it is not actually javascript: their strings are subtly incompatible (JSON allows U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR in quoted strings, javascript does not).