4 ms·
Yeah ok, but its also explicitly not allowed by the specification, both in text: > A number is very much like a C or Java number, except that the octal and hex
by svnpenn 7y ago
Yeah ok, but its also explicitly not allowed by the specification, both in text:
> A number is very much like a C or Java number, except that the octal and hexadecimal formats are not used.
and image:
https://json.org/img/number.png https://json.org/img/number.png
as shown literally on the JSON home page:
https://json.org https://json.org
I am all for good error handling, but at some point you do have to blame the user.
- setr 7y agoError messages are "blaming the user".. its job is to help inform the user the mistake he made. You can silently beat your child everytime he makes a mistake, until he accidentally does the job correctly (and doesn't get beaten), but it seems to me that making use of our ability to communicate can be much more efficient (and significantly less painful for the child). And json is merely a (very innefficient, and somewhat problematic) protocol for information exchange; it's not something you should expect people to have read the spec for, especially when its whole popularity stems from it being "intuitive" -- that is, you don't really need to read the spec to deal with it effectively