Discover more from Matt Rickard
The Heptagon of Configuration
The Heptagon of Configuration is a term I'm coining to describe a pattern I've observed in software configuration, where configuration evolves through specific, increasing levels of flexibility and complexity before returning to the restrictive and simple implementation.
How does the cycle work?
Hardcoded values are the simplest configuration - but provide very little flexibility. The program surface increases, and with it, the configuration, incorporating environment variables* and flags, and when that becomes cumbersome, a configuration file encodes the previous.
When multiple environments require similar configuration files, a templating language is used to eliminate repetition and promote the reuse of templates.
The templates grow in complexity until nearly every option in the configuration file is templated - rendering the reusability useless.
A Domain Specific Language (DSL) is invented to promote the reuse of logical blocks instead of using an inflexible, static template.
Since the DSL incorporates domain-specific knowledge by definition, every new function added increases the complexity for the end user. The code eventually becomes unreadable and unmaintainable, and the remaining programs are rewritten in Bash. Bash provides ultimate flexibility with a guise of reusability.
However, the Bash scripts are difficult to prove correctness and rely on fragile text manipulation to generate a configuration file or template.
The most used Bash scripts evolve into new CLIs with hard-coded behavior. The cycle continues.
*Fun fact: Environment variables celebrated their 40th birthday this year.