Concept

Configuration

Definition

Configuration is the practice of representing values that vary, or might vary, as external settings rather than constants buried in source code. Database URLs, feature flags, credentials, tuning parameters, and environment-specific behavior all belong outside the program logic.

The guiding principle is to parameterize your application using metadata. Code expresses how the system behaves; configuration expresses the specific choices for a given deployment, customer, or environment.

Why it matters

How it works

Settings are read from files, environment variables, a configuration service, or a database at startup or on demand. The program treats them as inputs, applying sensible defaults when a value is absent so the system fails gracefully rather than crashing.

The Pragmatic Programmer authors warn against the opposite extreme too: not everything should be configurable, because excessive options create their own complexity and untested combinations. The skill is choosing which decisions genuinely vary, externalizing those, and keeping stable logic in code where it can be reasoned about and tested.

Where it goes next

Continue exploring

Tags