5 ms·
JSON5 [0] is better as unlike Hjson, it doesn't include non-ECMASCript syntax. [0]: http://json5.org/ http://json5.org/
by nikolay 11y ago
JSON5 [0] is better as unlike Hjson, it doesn't include non-ECMASCript syntax.
[0]: http://json5.org/ http://json5.org/
- kstenerud 11y agoWhy do you need ECMAScript syntax? It's not like you're going to directly feed a json file into a JS interpreter. Well, not unless you have a death wish.
- lucideer 11y agoBecause it's a syntax that needs no extra explanation. It's not a superset, so no extra add-on features need extra doc, and it's less of a subset then JSON so the rules of what's disallowed are much simpler.
- emodendroket 11y agoAnd yet again no date format. Am I the only person who is ever inconvenienced by this? It seems like it's so obviously the most glaring flaw with JSON that I'm surprised nobody wants to fix it.
- rhinoceraptor 11y agoJust use ISO 8601?
- emodendroket 11y agoSure, that would be fine. They could also use a totally wacky format, I don't care. The problem is that without a standard the JSON tools in different languages don't all agree on how to serialize dates and you end up needing to deserialize/serialize manually the smooth over the differences. The problem isn't that you can't represent dates; it's that there is no standard way to do it.
- _kst_ 11y ago> The problem isn't that you can't represent dates; it's that there is no standard way to do it. ISO 8601?
- eknkc 11y agoThat is a string. Not date.
- emodendroket 11y agoThat's not "standard." That's one of many ways that people represent dates in JSON, because the JSON specification itself does not mandate that you use any particular representation. If you use it there is no guarantee it will be recognized as a date on the other end.
- Kapow 11y agoWhat black hole are you sending JSON into where the only way they could know something is a date is if you use a date type? Why can't that be part of the data structure you agreed upon in order to communicate in the first place?
- eknkc 11y agoEven if there is an agreed on schema, parsers can generate native Date objects on the recipient if there is a date type. When you deserialize a nested graph of objects, it's hard to convert each date to an actual date if what you get is just a string. Makes it a lot easier during integration.
- emodendroket 11y agoWhy am I hand-writing code to supplement the parser? I mean, hell, we don't need JSON at all, why don't I just invent my own serialization format and write parsers for it in each environment I want to use it in.
- duaneb 11y ago
- Zardoz84 11y agoSDLang have support for date formats.
- emodendroket 11y agoCool. Never used D and that's the first I've heard about it but I have respect for any system that handles this problem. :)