Why do so many programs use “foo.bar.baz = qux” style configurations?
up vote
3
down vote
favorite
I've noticed that tons of programs store configuration info in various hierarchial keys. For example, Firefox's about:config
has keys like network.http.pipelining
and network.http.pipelining.ssl
and network.http.use-cache
. I've noticed this style of configuration in Firefox, in OS X (Library/Preferences
), in sysctl
, among others. Why is it so common? Was there some early program that used it, so others copied it?
tree configuration-managment
add a comment |
up vote
3
down vote
favorite
I've noticed that tons of programs store configuration info in various hierarchial keys. For example, Firefox's about:config
has keys like network.http.pipelining
and network.http.pipelining.ssl
and network.http.use-cache
. I've noticed this style of configuration in Firefox, in OS X (Library/Preferences
), in sysctl
, among others. Why is it so common? Was there some early program that used it, so others copied it?
tree configuration-managment
When something is too complicated to handle effectively, you break it down into a hierarchy with smaller, more manageable components...
– Mehrdad
Feb 19 '13 at 0:33
I've reopened the question. It's not "not constructive", as can be seen in the very informative answers.
– slhck
Feb 19 '13 at 6:54
add a comment |
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I've noticed that tons of programs store configuration info in various hierarchial keys. For example, Firefox's about:config
has keys like network.http.pipelining
and network.http.pipelining.ssl
and network.http.use-cache
. I've noticed this style of configuration in Firefox, in OS X (Library/Preferences
), in sysctl
, among others. Why is it so common? Was there some early program that used it, so others copied it?
tree configuration-managment
I've noticed that tons of programs store configuration info in various hierarchial keys. For example, Firefox's about:config
has keys like network.http.pipelining
and network.http.pipelining.ssl
and network.http.use-cache
. I've noticed this style of configuration in Firefox, in OS X (Library/Preferences
), in sysctl
, among others. Why is it so common? Was there some early program that used it, so others copied it?
tree configuration-managment
tree configuration-managment
edited Dec 4 at 20:57
fixer1234
17.7k144581
17.7k144581
asked Feb 18 '13 at 23:06
cpast
2,11621325
2,11621325
When something is too complicated to handle effectively, you break it down into a hierarchy with smaller, more manageable components...
– Mehrdad
Feb 19 '13 at 0:33
I've reopened the question. It's not "not constructive", as can be seen in the very informative answers.
– slhck
Feb 19 '13 at 6:54
add a comment |
When something is too complicated to handle effectively, you break it down into a hierarchy with smaller, more manageable components...
– Mehrdad
Feb 19 '13 at 0:33
I've reopened the question. It's not "not constructive", as can be seen in the very informative answers.
– slhck
Feb 19 '13 at 6:54
When something is too complicated to handle effectively, you break it down into a hierarchy with smaller, more manageable components...
– Mehrdad
Feb 19 '13 at 0:33
When something is too complicated to handle effectively, you break it down into a hierarchy with smaller, more manageable components...
– Mehrdad
Feb 19 '13 at 0:33
I've reopened the question. It's not "not constructive", as can be seen in the very informative answers.
– slhck
Feb 19 '13 at 6:54
I've reopened the question. It's not "not constructive", as can be seen in the very informative answers.
– slhck
Feb 19 '13 at 6:54
add a comment |
2 Answers
2
active
oldest
votes
up vote
5
down vote
accepted
This hierarchical convention is there to provide clarity, helping us to know the scope of influence of each settings and to differentiate multiple settings with an identical or ambiguous name among various modules.
This is useful in applications with too many possible settings to include in the main user option pages (where the hierarchy is shown by tabs or pages), and a good alternative to plain INI files (with [title]
section delimiters) that are more prone to user error and usually require an application restart to take effect.
Hierarchal settings are also likely to reflect, to an extent, the internal top-down object-oriented model used by the developers:
In this example model, we could very well imagine a person.professor.disallow_strikes = true setting in there, while a students.disallow_strikes could remain to false or not be available at all. This compartmentalization is also the basis for Namespaces in programming languages (and the popular .NET framework follow the exact same naming convention: using System.Threading.Tasks
).
So, we now can assume that network.http.xxx
setting should not have influence on network.ftp
or other network submodules, while a network.xxx
setting will likely have influence on all of them.
The extra information is beneficial...
for the user: we have a better idea of which part of the application a given setting will have influence, making problems easier to troubleshoot (and avoid!)
and for the developers: the person working on or troubleshooting a specific module can be easily aware of which user-modifiable setting can affect his/her current work and concentrate on that.
add a comment |
up vote
4
down vote
You've mentioned one of the main reasons in your opening sentence: hierarchical keys.
Each group of keys is, uh, grouped. All the network related keys are network.something. All the http related keys are network.http.something and so on. This makes the key itself somewhat self-documenting what the value refers to. If one were to use the ini file style (which, to be clear, nothing would stop you from using these sorts of keys if you wanted) with [section] and key=value pairs, a given key may be ambiguous until the section is known. More over, the placement of keys in a file is important. Putting the ssl key in the [GUI] section is probably a mistake and may cause the key to be ignored. The a.b.c style should mean the order of keys in a file doesn't matter. If you read networking.http.ssl.key= it doesn't matter if the previous line was gui.background.color= or something else. The fully qualified key is named.
Why is it so common? It's bloody useful, that's why. It's also easy for humans to read and understand (on a key by key basis) and edit.
Where did it come from? I'd say C style structures which probably have a lineage I'm unaware of, and which have trickled down into many other programming languages as well. Setting a value in a C structure would be structure.property=value, and for nested structures structure.substructure.property=value and so on (though in real life, pointers would translate many of those dots into -> instead, but that's a minor trifle).
3
It's also like namespaces, the implication is that "." serves as a semantic separator.
– mr.spuratic
Feb 19 '13 at 0:02
Even better. What Mr. Spuratic said.
– SuperMagic
Feb 19 '13 at 0:07
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f554036%2fwhy-do-so-many-programs-use-foo-bar-baz-qux-style-configurations%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
This hierarchical convention is there to provide clarity, helping us to know the scope of influence of each settings and to differentiate multiple settings with an identical or ambiguous name among various modules.
This is useful in applications with too many possible settings to include in the main user option pages (where the hierarchy is shown by tabs or pages), and a good alternative to plain INI files (with [title]
section delimiters) that are more prone to user error and usually require an application restart to take effect.
Hierarchal settings are also likely to reflect, to an extent, the internal top-down object-oriented model used by the developers:
In this example model, we could very well imagine a person.professor.disallow_strikes = true setting in there, while a students.disallow_strikes could remain to false or not be available at all. This compartmentalization is also the basis for Namespaces in programming languages (and the popular .NET framework follow the exact same naming convention: using System.Threading.Tasks
).
So, we now can assume that network.http.xxx
setting should not have influence on network.ftp
or other network submodules, while a network.xxx
setting will likely have influence on all of them.
The extra information is beneficial...
for the user: we have a better idea of which part of the application a given setting will have influence, making problems easier to troubleshoot (and avoid!)
and for the developers: the person working on or troubleshooting a specific module can be easily aware of which user-modifiable setting can affect his/her current work and concentrate on that.
add a comment |
up vote
5
down vote
accepted
This hierarchical convention is there to provide clarity, helping us to know the scope of influence of each settings and to differentiate multiple settings with an identical or ambiguous name among various modules.
This is useful in applications with too many possible settings to include in the main user option pages (where the hierarchy is shown by tabs or pages), and a good alternative to plain INI files (with [title]
section delimiters) that are more prone to user error and usually require an application restart to take effect.
Hierarchal settings are also likely to reflect, to an extent, the internal top-down object-oriented model used by the developers:
In this example model, we could very well imagine a person.professor.disallow_strikes = true setting in there, while a students.disallow_strikes could remain to false or not be available at all. This compartmentalization is also the basis for Namespaces in programming languages (and the popular .NET framework follow the exact same naming convention: using System.Threading.Tasks
).
So, we now can assume that network.http.xxx
setting should not have influence on network.ftp
or other network submodules, while a network.xxx
setting will likely have influence on all of them.
The extra information is beneficial...
for the user: we have a better idea of which part of the application a given setting will have influence, making problems easier to troubleshoot (and avoid!)
and for the developers: the person working on or troubleshooting a specific module can be easily aware of which user-modifiable setting can affect his/her current work and concentrate on that.
add a comment |
up vote
5
down vote
accepted
up vote
5
down vote
accepted
This hierarchical convention is there to provide clarity, helping us to know the scope of influence of each settings and to differentiate multiple settings with an identical or ambiguous name among various modules.
This is useful in applications with too many possible settings to include in the main user option pages (where the hierarchy is shown by tabs or pages), and a good alternative to plain INI files (with [title]
section delimiters) that are more prone to user error and usually require an application restart to take effect.
Hierarchal settings are also likely to reflect, to an extent, the internal top-down object-oriented model used by the developers:
In this example model, we could very well imagine a person.professor.disallow_strikes = true setting in there, while a students.disallow_strikes could remain to false or not be available at all. This compartmentalization is also the basis for Namespaces in programming languages (and the popular .NET framework follow the exact same naming convention: using System.Threading.Tasks
).
So, we now can assume that network.http.xxx
setting should not have influence on network.ftp
or other network submodules, while a network.xxx
setting will likely have influence on all of them.
The extra information is beneficial...
for the user: we have a better idea of which part of the application a given setting will have influence, making problems easier to troubleshoot (and avoid!)
and for the developers: the person working on or troubleshooting a specific module can be easily aware of which user-modifiable setting can affect his/her current work and concentrate on that.
This hierarchical convention is there to provide clarity, helping us to know the scope of influence of each settings and to differentiate multiple settings with an identical or ambiguous name among various modules.
This is useful in applications with too many possible settings to include in the main user option pages (where the hierarchy is shown by tabs or pages), and a good alternative to plain INI files (with [title]
section delimiters) that are more prone to user error and usually require an application restart to take effect.
Hierarchal settings are also likely to reflect, to an extent, the internal top-down object-oriented model used by the developers:
In this example model, we could very well imagine a person.professor.disallow_strikes = true setting in there, while a students.disallow_strikes could remain to false or not be available at all. This compartmentalization is also the basis for Namespaces in programming languages (and the popular .NET framework follow the exact same naming convention: using System.Threading.Tasks
).
So, we now can assume that network.http.xxx
setting should not have influence on network.ftp
or other network submodules, while a network.xxx
setting will likely have influence on all of them.
The extra information is beneficial...
for the user: we have a better idea of which part of the application a given setting will have influence, making problems easier to troubleshoot (and avoid!)
and for the developers: the person working on or troubleshooting a specific module can be easily aware of which user-modifiable setting can affect his/her current work and concentrate on that.
edited May 5 '15 at 12:17
Chenmunka
2,78481931
2,78481931
answered Feb 19 '13 at 0:30
mtone
10.8k53658
10.8k53658
add a comment |
add a comment |
up vote
4
down vote
You've mentioned one of the main reasons in your opening sentence: hierarchical keys.
Each group of keys is, uh, grouped. All the network related keys are network.something. All the http related keys are network.http.something and so on. This makes the key itself somewhat self-documenting what the value refers to. If one were to use the ini file style (which, to be clear, nothing would stop you from using these sorts of keys if you wanted) with [section] and key=value pairs, a given key may be ambiguous until the section is known. More over, the placement of keys in a file is important. Putting the ssl key in the [GUI] section is probably a mistake and may cause the key to be ignored. The a.b.c style should mean the order of keys in a file doesn't matter. If you read networking.http.ssl.key= it doesn't matter if the previous line was gui.background.color= or something else. The fully qualified key is named.
Why is it so common? It's bloody useful, that's why. It's also easy for humans to read and understand (on a key by key basis) and edit.
Where did it come from? I'd say C style structures which probably have a lineage I'm unaware of, and which have trickled down into many other programming languages as well. Setting a value in a C structure would be structure.property=value, and for nested structures structure.substructure.property=value and so on (though in real life, pointers would translate many of those dots into -> instead, but that's a minor trifle).
3
It's also like namespaces, the implication is that "." serves as a semantic separator.
– mr.spuratic
Feb 19 '13 at 0:02
Even better. What Mr. Spuratic said.
– SuperMagic
Feb 19 '13 at 0:07
add a comment |
up vote
4
down vote
You've mentioned one of the main reasons in your opening sentence: hierarchical keys.
Each group of keys is, uh, grouped. All the network related keys are network.something. All the http related keys are network.http.something and so on. This makes the key itself somewhat self-documenting what the value refers to. If one were to use the ini file style (which, to be clear, nothing would stop you from using these sorts of keys if you wanted) with [section] and key=value pairs, a given key may be ambiguous until the section is known. More over, the placement of keys in a file is important. Putting the ssl key in the [GUI] section is probably a mistake and may cause the key to be ignored. The a.b.c style should mean the order of keys in a file doesn't matter. If you read networking.http.ssl.key= it doesn't matter if the previous line was gui.background.color= or something else. The fully qualified key is named.
Why is it so common? It's bloody useful, that's why. It's also easy for humans to read and understand (on a key by key basis) and edit.
Where did it come from? I'd say C style structures which probably have a lineage I'm unaware of, and which have trickled down into many other programming languages as well. Setting a value in a C structure would be structure.property=value, and for nested structures structure.substructure.property=value and so on (though in real life, pointers would translate many of those dots into -> instead, but that's a minor trifle).
3
It's also like namespaces, the implication is that "." serves as a semantic separator.
– mr.spuratic
Feb 19 '13 at 0:02
Even better. What Mr. Spuratic said.
– SuperMagic
Feb 19 '13 at 0:07
add a comment |
up vote
4
down vote
up vote
4
down vote
You've mentioned one of the main reasons in your opening sentence: hierarchical keys.
Each group of keys is, uh, grouped. All the network related keys are network.something. All the http related keys are network.http.something and so on. This makes the key itself somewhat self-documenting what the value refers to. If one were to use the ini file style (which, to be clear, nothing would stop you from using these sorts of keys if you wanted) with [section] and key=value pairs, a given key may be ambiguous until the section is known. More over, the placement of keys in a file is important. Putting the ssl key in the [GUI] section is probably a mistake and may cause the key to be ignored. The a.b.c style should mean the order of keys in a file doesn't matter. If you read networking.http.ssl.key= it doesn't matter if the previous line was gui.background.color= or something else. The fully qualified key is named.
Why is it so common? It's bloody useful, that's why. It's also easy for humans to read and understand (on a key by key basis) and edit.
Where did it come from? I'd say C style structures which probably have a lineage I'm unaware of, and which have trickled down into many other programming languages as well. Setting a value in a C structure would be structure.property=value, and for nested structures structure.substructure.property=value and so on (though in real life, pointers would translate many of those dots into -> instead, but that's a minor trifle).
You've mentioned one of the main reasons in your opening sentence: hierarchical keys.
Each group of keys is, uh, grouped. All the network related keys are network.something. All the http related keys are network.http.something and so on. This makes the key itself somewhat self-documenting what the value refers to. If one were to use the ini file style (which, to be clear, nothing would stop you from using these sorts of keys if you wanted) with [section] and key=value pairs, a given key may be ambiguous until the section is known. More over, the placement of keys in a file is important. Putting the ssl key in the [GUI] section is probably a mistake and may cause the key to be ignored. The a.b.c style should mean the order of keys in a file doesn't matter. If you read networking.http.ssl.key= it doesn't matter if the previous line was gui.background.color= or something else. The fully qualified key is named.
Why is it so common? It's bloody useful, that's why. It's also easy for humans to read and understand (on a key by key basis) and edit.
Where did it come from? I'd say C style structures which probably have a lineage I'm unaware of, and which have trickled down into many other programming languages as well. Setting a value in a C structure would be structure.property=value, and for nested structures structure.substructure.property=value and so on (though in real life, pointers would translate many of those dots into -> instead, but that's a minor trifle).
answered Feb 18 '13 at 23:54
SuperMagic
93555
93555
3
It's also like namespaces, the implication is that "." serves as a semantic separator.
– mr.spuratic
Feb 19 '13 at 0:02
Even better. What Mr. Spuratic said.
– SuperMagic
Feb 19 '13 at 0:07
add a comment |
3
It's also like namespaces, the implication is that "." serves as a semantic separator.
– mr.spuratic
Feb 19 '13 at 0:02
Even better. What Mr. Spuratic said.
– SuperMagic
Feb 19 '13 at 0:07
3
3
It's also like namespaces, the implication is that "." serves as a semantic separator.
– mr.spuratic
Feb 19 '13 at 0:02
It's also like namespaces, the implication is that "." serves as a semantic separator.
– mr.spuratic
Feb 19 '13 at 0:02
Even better. What Mr. Spuratic said.
– SuperMagic
Feb 19 '13 at 0:07
Even better. What Mr. Spuratic said.
– SuperMagic
Feb 19 '13 at 0:07
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f554036%2fwhy-do-so-many-programs-use-foo-bar-baz-qux-style-configurations%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
When something is too complicated to handle effectively, you break it down into a hierarchy with smaller, more manageable components...
– Mehrdad
Feb 19 '13 at 0:33
I've reopened the question. It's not "not constructive", as can be seen in the very informative answers.
– slhck
Feb 19 '13 at 6:54