4 ms·
JSON is not for people to write, despite what people try to do. It's for machines.
by davexunit 10y ago
JSON is not for people to write, despite what people try to do. It's for machines.
- pg314 10y agoFrom [1]: "JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write." [1] http://www.json.org/ http://www.json.org/
- davexunit 10y agoIt may say that, but it's main use is a serialization format for machines. The lack of comments makes it apparent that it is not for people. When you want comments, what you actually want to do is write code in a real programming language.
- matt4077 10y agoOr, maybe, our tools should evolve with an eye on how they are actually being used. JSON/YAML/TOML/INI are all intended to store arbitrary data structures, and are all required to be written and read by algorithms. It doesn't make sense to split that world into "these are usually created/consumed only by software" and "these are for humans".
- maxxxxx 10y agoThis whole thing is just a variation of the "you aren't doing it right" syndrome. Be it Scrum, OO, FP, XML, JSON, whenever you criticize one of them people will tell you "this is not what it was intended for" even though a lot of people use it that way.
- Spivak 10y agoBut the more valid form of this argument is "not the right tool for the job". Trying to be all encompassing is how we wound up with XML.
- jimbokun 10y agoThere are many, many situations when being able to write or edit JSON data by hand is extremely useful.
- maxxxxx 10y agoThat's not what I see happening. JSON is being used a lot for things that should be human readable. If we want formats purely for machines, we should go binary. Easier to parse and much more efficient.
- camus2 10y agoJSON comes from Javascript, it is totally for people to write, like they write Javascript object literals. If it wasn't the case, JSON would have been a binary format which is much for efficient for machines to read,write an transmit. That's also why a significant number of JSON libs support comments. they'll make their way into the spec, sooner or later, that's inevitable.
- onli 10y agoNothing is inevitable. If that really were to happen people like me (though I actually still use a lot of XML) would move on to the next simple data exchange format.