4 ms·
The problem is using JSON as a file format in the first place. It’s not designed for humans to edit. (Then again, it’s better than the Norway-sceptic YAML.)
by Kwpolska 2y ago
The problem is using JSON as a file format in the first place. It’s not designed for humans to edit. (Then again, it’s better than the Norway-sceptic YAML.)
- peterashford 2y agoI disagree. At least in an ought vs is sense: it's entirely the kind of format that I would create as an editable format. As witnessed by the fact that my workmates and I did create very nearly JSON previously as a file format in the 90s (but for C code programs)
- Kwpolska 2y agoFor a very narrow target audience (programmers), JSON is fine. If you want the file to be edited by anyone else, JSON is pain.
- deleted 2y ago[deleted]
- Cthulhu_ 2y agoBut it happens. 'npm install' will edit your json file, but so can I. That said, I don't like it as a config file read/written by humans.
- Jare 2y agoWhat example(s) of file format would you say are designed for humans to edit and still represent the kind of structured contents that json does?
- Kwpolska 2y agoI can’t think of anything that is not painful in some way.
- thayne 2y agoTOML, extensions of json like json5 and hjson, a bunch of lesser known formats for nested structures like NestedText, UCL, kdl, Eno,sdlang, eldf, etc. Also languages with some progrommatic capabilities like cue, dhall, jsonnet, nickel etc. Non of them are perfect, and some are less suitable for certain use cases than others. But IMO pretty much all of them are better for human editing than json, and in many cases yaml.
- tedunangst 2y agoJSON with trailing comma support.
- codedokode 2y agoAny format that: - doesn't require to quote everything - has lists/dictionaries - uses indentation and new lines instead of commas and brackets - doesn't have 1000 unnecessary features like YAML Also, you don't need all types from JSON.
- michaelmior 2y ago> you don't need all types from JSON JSON has a very minimal set of types and I regularly use all of them. I guess you could argue that integers and numbers could be combined, but I think that's it.