4 ms·
No, it was obviously and flagrantly incorrect, as evidenced by the success of interchange formats that do allow for comments, including many real world systems
by quotemstr 7mo ago
No, it was obviously and flagrantly incorrect, as evidenced by the success of interchange formats that do allow for comments, including many real world systems that pragmatically allow comments even when JSON says they shouldn't. This is Stockholm Syndrome.
But what can we expect from a spec that somehow deems comments bad but can't define what a number is?
- Spivak 7mo agoAs long as they stay comments there's no harm. As soon as they become struct tags and stripping comments affects the document's meaning you lose the plot.
- colonwqbang 7mo agoHow do you feel numbers are ill defined in json? The syntactical definition is clear and seems to yield a unique and obvious interpretation of json numbers as mathematical rational numbers. A given programming language may not have a built in representation for rational numbers in general. That isn't the fault of json.
- thaumasiotes 7mo agoI can't really tell what you're trying to say; JSON also has no representation for rational numbers in general. The only numeric format it allows is the standard floating point "2.01e+25" format. Try representing 1/3 that way. The usual complaint about numbers not being well-defined in JSON is that you have to provide all numbers as strings; 13682916732413492 is ill-advised JSON, but "13682916732413492" is fine. That isn't technically a problem in JSON; it's a problem in Javascript, but JSON parsers that handle literals the same way Javascript would turn out to be common. Your "defense", on the other hand, actually is a lack in JSON itself. There is no way to represent rational numbers numerically.
- colonwqbang 7mo agoI didn't say that json can represent all rational numbers. I said that all json numbers have an obvious interpretation as a rational number. So far you haven't really shown an example of a json number which has an ambiguous or ill defined interpretation. Maybe you mean that json numbers may not fit into 32 bit integers or double floats. That's certainly true but I don't see it as a deficiency in the standard. There is no limit on the size of strings in json, so why have a limit on numbers?
- thaumasiotes 7mo ago>> A given programming language may not have a built in representation for rational numbers in general. Why did you say this?