But I wouldn't ever use JSON5 over JSON for serialization, or over YAML for parsing a configuration file.
JSON5 Data Interchange Format
41–50 of 157 posts
Re: JSON5 Data Interchange Format
#42I think at this point a new json spec should have little/nothing to do with javascript.
Re: JSON5 Data Interchange Format
#43> "Strings may be single quoted." What's the point? I cringe every time a project uses both double quote and single quote, a mix of semicolon and no semicolon and a mix of tabs and space, .... Which one to pick isn't relevant as soon as the code base is consistent
It allows you to put double quotes in the string without escaping them, which is pretty nice.
E.g., how would you put the following sentence in a string:
You can use both " and ' to delimit a string.
Re: JSON5 Data Interchange Format
#44Earlier quoted context omitted.
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.
Re: JSON5 Data Interchange Format
#45Earlier quoted context omitted.
It allows you to put double quotes in the string without escaping them, which is pretty nice.
What if you want both? E.g., how would you put the following sentence in a string: You can use both " and ' to delimit a string.
"You can use both \" and ' to delimit a string"
Re: JSON5 Data Interchange Format
#46Earlier quoted context omitted.
Because: ‘I am “really” angry’ Is much nicer than: “I am \”really\” angry”
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.
"I'm \"really\" angry, don't do it again!"
Re: JSON5 Data Interchange Format
#47I'd love if they added support for dates, e.g. { justDate: @2020-02-08 } { dateAndTime: @2007-03-01T13:00:00Z } { justTime: @@13:00:00 }
Re: JSON5 Data Interchange Format
#48I know it’s not trendy but consider XML and schema at this point. XML allows all this to be expressed and more and schema allows the creation of integration contracts that can be validated at both ends. Tooling and libraries are mature.
JSON-schema is a thing as well, maybe not quite as mature (or "aged"), but the tooling is fine.
Re: JSON5 Data Interchange Format
#49> "Strings may be single quoted." What's the point? I cringe every time a project uses both double quote and single quote, a mix of semicolon and no semicolon and a mix of tabs and space, .... Which one to pick isn't relevant as soon as the code base is consistent
Re: JSON5 Data Interchange Format
#50I know it’s not trendy but consider XML and schema at this point. XML allows all this to be expressed and more and schema allows the creation of integration contracts that can be validated at both ends. Tooling and libraries are mature.
If you want to drop JSON altogether, something like Protobufs would be better. But JSON + JSONSchema has all the benefits of XML and none of the drawbacks.