4 ms·
Rigidity and consistency are not always bad things. They can help prevent bugs, security vulnerabilities, and they drastically reduce complexity of implementati
by JamilD 11y ago
Rigidity and consistency are not always bad things. They can help prevent bugs, security vulnerabilities, and they drastically reduce complexity of implementation.
JSON might often be too rigid, but I think it's important to note that "easier" (in that you don't need to learn the syntax) isn't always better.
- kstenerud 11y agoYes. There are two distinct use cases here: configuration files, and interchange formats. For an interchange format, JSON does the job very well. Small, simple, human readable, easy to implement. For a configuration format, JSON leaves a lot to be desired. It's almost there, but has enough warts to be annoying. You're not going to get a one-size-fits-all format.
- IvanK_net 11y agoThis "easier" format is actually more "complex". JSON can be described with just a couple of simple rules (http://json.org/ http://json.org/ ), while this format adds many new rules (e.g. for doing same things in multiple ways). The more rules you have, the more things you have to remember, the harder it is to find the reason of the problem. BTW. it is very simple to do comments in JSON :) You can just add "comment1" : "This is my comment", to any object, it will be ignored by software that processes your file.
- mort96 11y agoI kind of like doing comments like this: "#": " my comment"
- ZenPsycho 11y agothe problem with that one is that some parsers have a meltdown if they encounter duplicate keys. sigh
- abraae 11y agoHa ha, I do exactly the same thing. Lack of comments is really the only beef I have with Json (well, no multi line text too I suppose). A new spec that just addressed those alone would be great.
- collyw 11y agoThis sounds more like Python dictionaries. I don't see more bugs when I am using those over JSON, and I find them a lot easier to work with.