3 ms·
> JSON is a poor format for humans Depends on which kind of humans. For the regular non tech types I agree JSON is poor. A couple of years ago I created a min
by pier25 8y ago
> JSON is a poor format for humans
Depends on which kind of humans.
For the regular non tech types I agree JSON is poor. A couple of years ago I created a mini spec for a config file so that very low tech paper designers could configure an interactive book.
For programmers, JSON works fine in my experience.
- tonyarkles 8y ago> For programmers, JSON works fine in my experience. The author mentions this, and I very strongly agree. What JSON significantly misses is the ability to have comments in your configuration files. I'm not going to hold up the Apache config files as an example of amazing config formats, but... here's an example: https://svn.apache.org/repos/infra/websites/cms/webgui/conf/httpd.conf https://svn.apache.org/repos/infra/websites/cms/webgui/conf/... That's awesome. It describes options that are available and not enabled, and what they do. Right. In. The. File. Comparing that to, say, webpack config... there's a pile of research needed to figure out what options are even available, let alone what they do.
- jlarocco 8y agoYeah, that's the #1 problem with JSON as a config file format, IMO, and the Apache logs, among others, are a perfect example of why. All the other arguments for or against it boil down to personal preference, but not having comments is a real miss.
- datavirtue 8y agoHow does json prevent you from using comments? It does what you tell it to do. It is an object representation. So make your objects have comments...magic.
- andybak 8y ago> For programmers, JSON works fine in my experience. Programmers will maybe cope better but just being a programmer doesn't make you magically immune to poor readability and lack of comments. Most of the points in that article apply to programmers as much as non-programmers. (I agree there is a reasonable debate to be had about programmability - I'm on the fence about this one)
- goostavos 8y agoScale is the important thing here. Even if you're a magical superior human programmer variant, json sucks once you cross over 50 lines. Cloud Formation is a great example of the failures of JSON. Specifying just a single dynamo table with indexes and scaling roles in JSON is a hard to read cluster of a mess. Even with a good idea and json collapse / expand help, large json files are just insufferable to deal with as a human
- Bahamut 8y agoI'd say if you're crossing over 50 lines, it's going to suck no matter what format you're in. Other solutions are not really going to fare any better than JSON at that level.
- int_19h 8y agoXML + XInclude would allow you to break it all into multiple files, for example.
- datavirtue 8y agoCreate objects in code and serialize. Boy that was hard. I feel like everyone on this thread is going mental.