Patterns
Overview
Patterns are reusable solutions to common software design problems.
Why It Matters
Patterns help you avoid reinventing the same structure repeatedly.
Core Concepts
- A pattern should solve a real repeating problem.
- Patterns can help or hurt depending on fit.
- Naming a pattern should clarify, not impress.
Mental Models
Ask whether the pattern reduces change cost or just adds ceremony.
Best Practices
- Prefer familiar patterns.
- Use patterns deliberately, not by habit.
- Remove patterns that no longer pay for themselves.
Common Mistakes
- Forcing a pattern onto every problem.
- Using a pattern because it sounds senior.
- Letting the pattern become more important than the outcome.
Trade-offs
Patterns improve consistency and speed when repeated, but they can become dead weight when the problem is simple.
Decision Framework
| Use a pattern when | Avoid when |
|---|---|
| The same issue repeats | It is a one-off |
| The trade-off is understood | The abstraction is unclear |
Examples
- Container/presentational separation.
- Feature flags for staged rollout.
- Adapter layers at API boundaries.
Checklists
- Does the pattern solve a repeated problem?
- Is it understandable to the team?
- Would simpler code be better?
Senior Engineer Notes
Senior engineers like patterns that reduce thinking, not patterns that create new vocabulary problems.