5 ms·
JSON is explicitly not designed to be hand-editable. Hence, for example, no comments. It's just meant to be human readable. If you want human editable "json",
by Patient0 13y ago
JSON is explicitly not designed to be hand-editable. Hence, for example, no comments.
It's just meant to be human readable.
If you want human editable "json", use Yaml: http://www.yaml.org/ http://www.yaml.org/ (it's a superset of Json that adds comments, linking etc.)
- oneeyedpigeon 13y agoHow is YAML a superset of JSON? Do you mean 'conceptually'?
- icebraining 13y agoNo, it is a superset. Every JSON document is a valid YAML document.
- _delirium 13y agoIt's technically true because YAML includes an alternate "inline style" that lets you write objects in JSON syntax. Therefore any JSON object is a valid YAML object as well. But, not an idiomatically written YAML object, since writing YAML using only inline style is unusual.
- turnip1979 13y agoTo be specific, JSON syntax is a subset of YAML version 1.2. However, I hate YAML with a passion. It is worse than XML in my books. I can usually read JSON fine. I can also read XML in many cases. For the life of me, I just can't read YAML. It has something to do with "-", line indentation and different ways of writing lists. Of course, someone will say YAML is technically better ...
- buster 13y agoDifferent for me, i would prefer YAML over XML or JSON
- turnip1979 13y agoDo you use your naked eyes or do you have any tool recommendations? I don't see YAML going away so I'd better deal :)
- ctb_mg 13y agoSame here, it is very difficult for me to tell levels of nested structures in yaml. Though I'm sure if I sat down and read up on it I could force it into my brain. But shouldn't it be intuitive to read without that?
- snogglethorpe 13y agoPrecisely. Python has exactly the same problem -- control-structure nesting quickly gets confusing and hard to read beyond a certain (fairly small) size -- but at least with python, you have the option of splitting off stuff into separate functions to limit the amount of nesting and size of blocks.
- hrjet 13y agoI find HOCON better than YAML: https://github.com/typesafehub/config/blob/master/HOCON.md https://github.com/typesafehub/config/blob/master/HOCON.md