| > To make a system sufficiently configurable, you end up having to re-invent a turing complete language inside it's configuration files... Isn't source code basically a configuration file for the compiler/interpreter? > because ultimately the config format can never be expressive enough to solve all the problems And if so, I don't think this statement is quite true. Source code is expressive enough. Configuration files give us flexibility but not expressiveness. Source code, as it exists today, gives us expressiveness but not flexibility[1]. This disparity should be a big red flag that we are doing something really wrong. This disparity, in my opinion, is caused by the abstraction we use to communicate information between systems within source code: parameterized sub-routines. A programming language that doesn't use parameterized sub-routines is basically a configuration file. This gives us both expressiveness and flexibility. [1] Flexibility is within the context of config-vs-source code and ops post. Programming languages are very flexible when you know them. |
Source code is input, not configuration. Every time you run the compiler, you give it different source code. The whole point of the compiler is to transform source code.
Configuration is "input" that is not expected to change very often, but that the application developer can not guarantee will never change. Configuration falls into a few categories:
1. Context-specific inputs that can not be predicted or discovered automatically by the application. (For example, the DNS zones the process is expected to host - named.conf)
2. Inputs that are not expected to change very often, but should be easy to change if necessary. (ssh client or server settings)
3. For applications with interactive user interfaces, customization and changes to the default interface.
For the vast majority of applications, a text file capable of expressing simple data structures is more than sufficient. Others advocate using only a database, but only to make configuration dynamic so explicit reloads aren't necessary, not to make it more like a programming language.
The source-vs-configuration question is usually only be an issue when dealing with large, complex applications with very general specifications.