Most applications treat configuration as an afterthought.
A .env file here.
A config object there.
Maybe a JSON or YAML file for convenience.
Configuration is usually seen as:
- Setup
- Defaults
- Environment variables
But not the system itself.
That’s the mistake.
What We Typically Do
In most projects, the real logic lives in code:
- Routes define behavior
- Functions define flow
- Classes define structure
Configuration just tweaks things:
- Ports
- API keys
- Feature flags
It supports the system.
It doesn’t define it.
The Problem With Code-First Systems
When behavior is defined primarily in code:
- Logic becomes scattered
- Patterns become inconsistent
- Intent is harder to see
You have to read through multiple files to understand:
- What an endpoint does
- What data it expects
- What it returns
The system exists…
…but it’s buried in implementation.
The Shift: Configuration as the Source of Truth
What if configuration didn’t just support the system…
What if it defined it?
Instead of writing behavior first and configuring it later:
You define behavior up front.
Code becomes the execution layer.
What This Looks Like
Instead of writing logic like this:
app.get('/products', async (req, res) => {
const products = await db.products.findAll();
res.json(products);
});
You define it like this:
get:
product:
GetAllProducts:
query: all
response:
id: number
name: string
price: number
The definition describes the system.
The code runs it.
Configuration Becomes the Interface
When configuration is the system:
- It becomes the first place you look
- It becomes the documentation
- It becomes the contract
You don’t need to reverse-engineer behavior.
You can read it directly.
Code Becomes the Engine
If configuration defines behavior, then what does code do?
It enforces and executes.
- Parses definitions
- Validates structure
- Builds execution steps
- Runs pipelines
- Handles errors consistently
You write the engine once.
You use it everywhere.
Why This Matters
Visibility
You can understand the system without digging through code.
Consistency
Every feature follows the same structure.
Maintainability
Change the engine, and everything improves.
Speed
You’re not rewriting patterns.
You’re defining variations.
“Isn’t This Limiting?”
Yes.
And that’s the point.
When everything is possible:
- Patterns drift
- Systems become inconsistent
- Complexity increases
Constraints force:
- Clarity
- Discipline
- Predictability
Where This Breaks Down
Not everything should be configuration-driven.
Highly custom logic still belongs in code.
But most applications are not mostly custom.
They are mostly patterns.
- CRUD operations
- Validation
- Data transformation
- Standard workflows
Those belong in configuration.
The Layered View
When you zoom out, this approach connects everything:
- UI defined by structure
- APIs defined by contracts
- Backends acting as compilers
- Requests flowing through pipelines
- Infrastructure defined declaratively
Each layer follows the same idea:
Define first. Execute second.
The Bigger Shift
This isn’t about YAML vs code.
It’s about mindset.
From:
- Writing behavior repeatedly
To:
- Defining behavior once
And letting a system handle the rest.
Final Thought
Configuration has always been treated as secondary.
But when you promote it to the source of truth, something changes:
The system becomes visible.
The system becomes consistent.
The system becomes scalable.
That’s when you stop assembling applications…
Top comments (0)