▲ 43 ▼ What is the best file format for configuration file? (programming.dev) submitted 3 years ago by likeaduck@programming.dev to c/experienced_devs@programming.dev 47 comments fedilink hide all child comments .yaml, .toml, etc?
[–] simonced@lemmy.one 16 points 3 years ago (4 children) A lot of good answers but I would add one note: use a format that supports comments, and JSON is not one of those... permalink fedilink source hideshow 8 child comments replies: [+] AeroLemming@lemm.ee 12 points 3 years ago* (last edited 2 years ago) (3 children) [deleted] permalink fedilink source parent hideshow 6 child comments replies: [–] noli@programming.dev 17 points 3 years ago You disgust me permalink fedilink source parent [–] sfera@beehaw.org 1 point 2 years ago (1 child) How do you comment multiple properties separately? permalink fedilink source parent hideshow 2 child comments replies: [+] AeroLemming@lemm.ee 2 points 2 years ago* (last edited 2 years ago) (1 child) [deleted] permalink fedilink source parent hideshow 2 child comments replies: [–] sfera@beehaw.org 1 point 2 years ago Don't worry, I wouldn't do things like this in JSON. Nevertheless, it can be very useful to have comments along with configuration values, for example to explain the actual values (not their purpose) and why they were chosen. That's information you can't add to the code which processes the values. permalink fedilink source parent [–] simonced@lemmy.one 1 point 3 years ago (1 child) This is actually pretty genius, why haven't ever thought of that? permalink fedilink source parent hideshow 2 child comments replies: [+] AeroLemming@lemm.ee 1 point 3 years ago* (last edited 2 years ago) (1 child) [deleted] permalink fedilink source parent hideshow 2 child comments replies: [–] simonced@lemmy.one 1 point 3 years ago (1 child) I liked the idea to be honest. I can just call the entry "description" instead and all is good ^^ permalink fedilink source parent hideshow 2 child comments replies: [+] AeroLemming@lemm.ee 2 points 3 years ago* (last edited 2 years ago) [deleted] permalink fedilink source parent [–] ChairmanMeow@programming.dev 3 points 3 years ago I believe the JSON deserializer .NET ships with has options to allow C#-style comments in JSON files. permalink fedilink source parent [–] kersplort@programming.dev 2 points 3 years ago JSON5 is a superset of JSON that supports comments. permalink fedilink source parent [–] vrighter@discuss.tchncs.de 1 point 3 years ago json with comments can be parsed by a yaml parser. It's how I write yaml, in fact (yaml is a superset of json. any valid json is valid yaml, but it also supports comments) permalink fedilink source parent
[+] AeroLemming@lemm.ee 12 points 3 years ago* (last edited 2 years ago) (3 children) [deleted] permalink fedilink source parent hideshow 6 child comments replies: [–] noli@programming.dev 17 points 3 years ago You disgust me permalink fedilink source parent [–] sfera@beehaw.org 1 point 2 years ago (1 child) How do you comment multiple properties separately? permalink fedilink source parent hideshow 2 child comments replies: [+] AeroLemming@lemm.ee 2 points 2 years ago* (last edited 2 years ago) (1 child) [deleted] permalink fedilink source parent hideshow 2 child comments replies: [–] sfera@beehaw.org 1 point 2 years ago Don't worry, I wouldn't do things like this in JSON. Nevertheless, it can be very useful to have comments along with configuration values, for example to explain the actual values (not their purpose) and why they were chosen. That's information you can't add to the code which processes the values. permalink fedilink source parent [–] simonced@lemmy.one 1 point 3 years ago (1 child) This is actually pretty genius, why haven't ever thought of that? permalink fedilink source parent hideshow 2 child comments replies: [+] AeroLemming@lemm.ee 1 point 3 years ago* (last edited 2 years ago) (1 child) [deleted] permalink fedilink source parent hideshow 2 child comments replies: [–] simonced@lemmy.one 1 point 3 years ago (1 child) I liked the idea to be honest. I can just call the entry "description" instead and all is good ^^ permalink fedilink source parent hideshow 2 child comments replies: [+] AeroLemming@lemm.ee 2 points 3 years ago* (last edited 2 years ago) [deleted] permalink fedilink source parent
[–] sfera@beehaw.org 1 point 2 years ago (1 child) How do you comment multiple properties separately? permalink fedilink source parent hideshow 2 child comments replies: [+] AeroLemming@lemm.ee 2 points 2 years ago* (last edited 2 years ago) (1 child) [deleted] permalink fedilink source parent hideshow 2 child comments replies: [–] sfera@beehaw.org 1 point 2 years ago Don't worry, I wouldn't do things like this in JSON. Nevertheless, it can be very useful to have comments along with configuration values, for example to explain the actual values (not their purpose) and why they were chosen. That's information you can't add to the code which processes the values. permalink fedilink source parent
[+] AeroLemming@lemm.ee 2 points 2 years ago* (last edited 2 years ago) (1 child) [deleted] permalink fedilink source parent hideshow 2 child comments replies: [–] sfera@beehaw.org 1 point 2 years ago Don't worry, I wouldn't do things like this in JSON. Nevertheless, it can be very useful to have comments along with configuration values, for example to explain the actual values (not their purpose) and why they were chosen. That's information you can't add to the code which processes the values. permalink fedilink source parent
[–] sfera@beehaw.org 1 point 2 years ago Don't worry, I wouldn't do things like this in JSON. Nevertheless, it can be very useful to have comments along with configuration values, for example to explain the actual values (not their purpose) and why they were chosen. That's information you can't add to the code which processes the values. permalink fedilink source parent
[–] simonced@lemmy.one 1 point 3 years ago (1 child) This is actually pretty genius, why haven't ever thought of that? permalink fedilink source parent hideshow 2 child comments replies: [+] AeroLemming@lemm.ee 1 point 3 years ago* (last edited 2 years ago) (1 child) [deleted] permalink fedilink source parent hideshow 2 child comments replies: [–] simonced@lemmy.one 1 point 3 years ago (1 child) I liked the idea to be honest. I can just call the entry "description" instead and all is good ^^ permalink fedilink source parent hideshow 2 child comments replies: [+] AeroLemming@lemm.ee 2 points 3 years ago* (last edited 2 years ago) [deleted] permalink fedilink source parent
[+] AeroLemming@lemm.ee 1 point 3 years ago* (last edited 2 years ago) (1 child) [deleted] permalink fedilink source parent hideshow 2 child comments replies: [–] simonced@lemmy.one 1 point 3 years ago (1 child) I liked the idea to be honest. I can just call the entry "description" instead and all is good ^^ permalink fedilink source parent hideshow 2 child comments replies: [+] AeroLemming@lemm.ee 2 points 3 years ago* (last edited 2 years ago) [deleted] permalink fedilink source parent
[–] simonced@lemmy.one 1 point 3 years ago (1 child) I liked the idea to be honest. I can just call the entry "description" instead and all is good ^^ permalink fedilink source parent hideshow 2 child comments replies: [+] AeroLemming@lemm.ee 2 points 3 years ago* (last edited 2 years ago) [deleted] permalink fedilink source parent
[+] AeroLemming@lemm.ee 2 points 3 years ago* (last edited 2 years ago) [deleted] permalink fedilink source parent
[–] ChairmanMeow@programming.dev 3 points 3 years ago I believe the JSON deserializer .NET ships with has options to allow C#-style comments in JSON files. permalink fedilink source parent
[–] kersplort@programming.dev 2 points 3 years ago JSON5 is a superset of JSON that supports comments. permalink fedilink source parent
[–] vrighter@discuss.tchncs.de 1 point 3 years ago json with comments can be parsed by a yaml parser. It's how I write yaml, in fact (yaml is a superset of json. any valid json is valid yaml, but it also supports comments) permalink fedilink source parent