4 ms·
Wait until you visit the link and read what “object” means in JSON, especially the part about remaining interchangeable with all programming languages
by softwarebeware 5y ago
Wait until you visit the link and read what “object” means in JSON, especially the part about remaining interchangeable with all programming languages
- stickfigure 5y ago"All" programming languages have some concept of a timestamp, or at the very least can manage a coherent mapping. Adding timestamp to JSON would introduce no portability issues. It would reduce portability issues by standardizing a commonly used data type. "My programming language doesn't have timestamps" is not a real problem. "Ten thousand stupid date formats which are all ambiguous with either numbers or strings" is an actual problem that people bang their heads into every day.
- softwarebeware 5y ago> Adding timestamp to JSON . . . What are you talking about? JSON is a format for exchanging data of any kind. It doesn't have types beyond a set of primitives to that it can remain as a _notation_ that allows you to pass any type you define and want to send. Nothing is stopping any library or language from implementing an object or String for dates or times (or both) and tons of them have done so. It wouldn't be JSON's place at all to start defining anything like that.
- stickfigure 5y agoNonsense. JSON (or "JSON++") can define any arbitrary primitives. Someone already made the arbitrary decision to have boolean values instead of "true" and "false" strings; having timestamps is merely another arbitrary decision. You seem to believe that the primitives in JSON are some sort of platonically pure form. They were merely a choice, and a that choice could be improved.