5 ms·
I was crossing my fingers for that too. I create JSON files a lot. It's annoying when I'm _reordering_ elements separated by newlines. It's annoying when I'm
by undershirt 13y ago
I was crossing my fingers for that too. I create JSON files a lot. It's annoying when I'm _reordering_ elements separated by newlines. It's annoying when I'm generating JSON files and I have to code in a special case to skip the comma. It breaks the consistency that I just desire as a programmer.
- Touche 13y agoWhy do you manually code json?
- VMG 13y agobecause that is what json is for
- optymizer 13y agono, that's not what json for. JSON is for exchange data between machines. We already have data interchange formats for humans, we call those 'languages'.
- mercurial 13y agoYes, yes. And we could also have everything as binary. Now, UNIX people decided long ago to use plain text to communicate between processes, mostly because it's infinitely easier to read - and makes it possible to edit by hand if you need to. Have to interface with a REST API which consumes JSON and you want to do some testing? Open your text editor anywhere curl is installed, and you're done. That's pretty damn convenient.
- Zikes 13y agoAlso becoming commonplace as a config file format.
- mercurial 13y agoYeah. On the other hand, I find YAML much better for this kind of thing. JSON is readable and writable by hand, but it's not terribly nice.
- Zikes 13y agoNo doubt they both have their benefits, however in an environment particularly suited for working with JSON, like node.js, the additional overhead of a YAML (or other) parser may not be desirable.
- mercurial 13y agoWhy not? After all, since JSON is not a proper Javascript subset, you still need to parse it somehow. And as JSON is a proper subset of YAML, you should get by with a YAML parser.
- Ygg2 13y agoI think JSON being a subset of yaml is one of THE biggest mistakes YAML made, second only to making YAML a serialization format.
- optymizer 13y agoWe can't have everything as binary, because us humans can't even agree on which bit is most significant out of a list of 64/32/16/8 bits.
- VMG 13y agojson.org: > JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write.
- optymizer 13y agoThe primary purpose of JSON is to exchange data between machines. You may have missed that part. Sure, it's easy to read and write by humans, because it's simple, but that's not what it is for (which is what I was disagreeing with). Humans communicate better using a natural language, not JSON, as evidenced by the fact that both our comments are in English, not JSON. And 'easy' is relative anyway. Some of my users have to write JSON (they're not developers). It would be much easier for them if the UI had built the JSON for them, while they click on buttons.
- GrinningFool 13y agoIt must be nice to live in a world in which you never have to read JSON. Or, for that matter, any other format which is used to exchange data between machines - binary included. Worse, sometimes even XML. I should like to visit that world one day.
- AYBABTME 13y agoIf so, use Protobuf, BSON and jump in the wagon for SPDY. Why JSON at all if you don't care about reading it? I'm not against Protobuf, BSON, SPDY and the likes, my argument is just that JSON is used over binary formats only because it's readable.
- VMG 13y agobecause that is what json is for
- undershirt 13y agoI built a game that uses JSON for metadata and config files.
- stormbrew 13y agoYou could have used yaml. ... The irony of yaml being human and version control friendly but including massive amounts of serialization mechanism vs. json being for data exchange and having extremely rudimentary serialization features aside.
- Skalman 13y agoI frequently use it for settings.