2 ms·
Commenting in complex configs is actually a highly compressed signal for communicating a lot of information without a lot of unwieldy external documentation. IN
by wenc 7y ago
Commenting in complex configs is actually a highly compressed signal for communicating a lot of information without a lot of unwieldy external documentation. INI files support comments. apache.conf or any number of Linux config file support comments.
Also, executable configurations are not uncommon. Consider .bashrc or .vimrc. And they're usually loaded with multi-line comments.
Embedding comments in JSON fields gets unwieldy really quick for long configs. Compare:
{
"generalcomment": "the quick brown fox\njumps over the lazy dog",
"setting1" : {},
"setting1comment" : "this is setting1",
"setting2tree": {
"setting2a": {},
"setting2acomment: "this is supposed to do this",
"setting2b": {},
"setting2bcomment: "this is supposed to do this"
},
"setting3": [1,2,3]
"setting3comment": "to use this setting, do this"
}
To:
// The quick brown fox
// jumps over the lazy dog.
{
"setting1" : {}, // this is setting1
"setting2tree": {
"setting2a": {}, // this is supposed to do this
"setting2b": {}, // this is supposed to do this
},
"setting3": [1,2,3] // to use this setting, do this
}