News for hackers. Stuff that matters.
Re:JSON as configuration files: please don’t (2016) by pier25 on Saturday April 13, 2019 @01:51PM (#19654566)
> 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.

Re:JSON as configuration files: please don’t (2016) by tonyarkles on Saturday April 13, 2019 @02:07PM (#19654660)
> 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/...

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.

Re:JSON as configuration files: please don’t (2016) by jlarocco on Saturday April 13, 2019 @04:26PM (#19655515)
Yeah, 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.

Re:JSON as configuration files: please don’t (2016) by goostavos on Saturday April 13, 2019 @03:02PM (#19655053)
Scale 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

Re:JSON as configuration files: please don’t (2016) by Bahamut on Saturday April 13, 2019 @03:42PM (#19655301)
I'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.
Re:JSON as configuration files: please don’t (2016) by int_19h on Saturday April 13, 2019 @09:33PM (#19656972)
XML + XInclude would allow you to break it all into multiple files, for example.
Re:JSON as configuration files: please don’t (2016) by andybak on Saturday April 13, 2019 @02:44PM (#19654923)
> 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)