News for hackers. Stuff that matters.
Re:JSON as configuration files: please don’t (2016) by kejaed on Saturday April 13, 2019 @12:32PM (#19653983)
So what is your favourite format for config files?
Re:JSON as configuration files: please don’t (2016) by pr0tocol_7 on Saturday April 13, 2019 @12:33PM (#19653997)
I like Toml for my config files. Clear and simple format.
Re:JSON as configuration files: please don’t (2016) by mkobit on Saturday April 13, 2019 @12:45PM (#19654097)
I've had good experiences on the JVM using HOCON [1].

[1]: https://github.com/lightbend/config/blob/b782a2d701fc2b04579...

Re:JSON as configuration files: please don’t (2016) by cobookman on Saturday April 13, 2019 @12:34PM (#19654008)
YAML.

All the benefits of JSON with none of the negatives.

Re:JSON as configuration files: please don’t (2016) by iampims on Saturday April 13, 2019 @12:37PM (#19654032)
YAML is whitespace sensitive, that alone is a nightmare.
Re:JSON as configuration files: please don’t (2016) by nixpulvis on Saturday April 13, 2019 @12:46PM (#19654099)
Yes, as someone who helps with some software with a YAML config, the whitespace issue has caused much time in IRC spent trading pastebins fixing these.

I agree overall YAML looks pretty nice, and consistent whitespace is a strong preference (I have pre-commit hooks), breaking user (if you have them) config if they don't know about this is an issue tho.

Re:JSON as configuration files: please don’t (2016) by the_imp on Saturday April 13, 2019 @02:27PM (#19654795)
Do note that in addition to block collections, YAML also supports the flow collections of JSON, which are not whitespace sensitive. In fact, YAML 1.2 is a superset of JSON, and you can parse JSON with # comments as entirely valid YAML.
Re:JSON as configuration files: please don’t (2016) by ohaideredevs on Saturday April 13, 2019 @12:37PM (#19654033)
As someone who uses YAML and doesn't know it well (Thanks for nothing Docker & K8s) - I see absolutely zero difference between the two as far as one being better than the other goes, except the whitespace sensitivity which the other user mentioned, which really is a pain.
Re:JSON as configuration files: please don’t (2016) by sdenton4 on Saturday April 13, 2019 @12:34PM (#19653998)
protobuffers now! protobuffers forever!
Re:JSON as configuration files: please don’t (2016) by nixpulvis on Saturday April 13, 2019 @12:37PM (#19654034)
You doing stuff with multiple languages/frameworks?