News for hackers. Stuff that matters.
Re:JSON as configuration files: please don’t (2016) by Filligree on Saturday April 13, 2019 @02:04PM (#19654651)
Why would you limit yourself to those two options? Use TOML or something.
Re:JSON as configuration files: please don’t (2016) by amelius on Saturday April 13, 2019 @02:20PM (#19654743)
TOML kinda breaks down when you have nested data:

https://stackoverflow.com/questions/48998034/does-toml-suppo...

Re:JSON as configuration files: please don’t (2016) by Dylan16807 on Saturday April 13, 2019 @04:08PM (#19655448)
The answer to the question is "yes it is supported", it doesn't break down at all.

It's even in the example file https://github.com/toml-lang/toml/blob/master/examples/examp...

Re:JSON as configuration files: please don’t (2016) by je42 on Saturday April 13, 2019 @05:19PM (#19655804)
looks quite ugly. repeating keys... yaml looks better (while it has other problems)
Re:JSON as configuration files: please don’t (2016) by ChrisSD on Saturday April 13, 2019 @02:45PM (#19654931)
Your link shows nested data structures working? But regardless TOML is a configuration file format (like INI), not a general purpose data structure format (like JSON is).
Re:JSON as configuration files: please don’t (2016) by TheDong on Saturday April 13, 2019 @04:45PM (#19655603)
> general purpose data structure format

General purpose until you need to store dates/times, self-referential structures, enums, etc.

json and toml are both serializations of data. I don't think the line you're trying to draw between "configuration file format" and "data structure format" is a well-defined line.

Re:JSON as configuration files: please don’t (2016) by ChrisSD on Saturday April 13, 2019 @05:00PM (#19655690)
Sure it's a blurry line but some formats are better than others for some specific tasks. JSON isn't the right tool for every job but it's a good enough lowest common denominator for data sharing.

I wouldn't want to use if for config files or passing complex data but then it's not designed for that.

Re:JSON as configuration files: please don’t (2016) by afiori on Saturday April 13, 2019 @05:59PM (#19656007)
TOML also has more "normal" notations for dicts and lists that are almost the same as JSON.

There is a distinction between markup languages e object notation languages. XML, HTML and Markdown are markup, JSON, YAML, TOML and most other are object notations.

(here my distinction, in general, is if they allow unquoted text)