Carving Code All articles
Software Craftsmanship

Stop Collecting Patterns. Start Seeing Them.

Carving Code
Stop Collecting Patterns. Start Seeing Them.

Ask a developer fresh out of a design patterns course what the Observer pattern is, and they'll nail it. Ask them to spot where their current codebase is crying out for one, and you'll get a blank stare.

That gap — between knowing a pattern and recognizing when it applies — is where most developers get stuck. And it's not a knowledge problem. It's a perception problem.

The way patterns are typically taught encourages collection. You work through the Gang of Four, maybe a Udemy course, maybe a few blog posts, and you end up with a mental catalog of named solutions. Factory, Strategy, Decorator, Command. You know what they look like in a textbook. But codebases don't look like textbooks.

The Catalog Trap

There's a specific failure mode that emerges from pattern memorization without pattern recognition: you start fitting problems to patterns instead of the other way around.

You've just learned the Visitor pattern. Suddenly, everything looks like it needs a Visitor. You introduce it into a module that would've been fine with a simple switch statement, and now three junior developers can't follow the logic without a diagram and a prayer.

This isn't a knock on learning patterns — they encode genuinely hard-won wisdom. The problem is the sequence. When you learn the solution before you've sat with the problem long enough to feel its shape, you skip the most important part of the education: developing the instinct for when something is actually wrong.

Seasoned developers don't flip through a mental catalog when they encounter a messy module. They feel friction first. Something about the code bothers them — a vague discomfort with how responsibilities are distributed, a nagging sense that this thing is doing too much, a recognition that they've debugged this same category of problem three times in the past month. The pattern name comes later, if it comes at all.

What Deliberate Observation Actually Looks Like

Training your eye for patterns in your own codebase is less about studying and more about slowing down.

Most developers move through code in a state of mild urgency. There's a ticket to close, a PR to review, a standup in twelve minutes. In that mode, you process just enough to get the job done and move on. Pattern recognition requires a different gear — one where you're reading code the way a craftsman examines a piece of wood before deciding how to cut it.

Here are the specific things worth watching for:

Repetition with variation. When you see the same structure appearing in multiple places with slight differences — similar method signatures, parallel conditional logic, analogous data transformations — that's your codebase showing you something. It might be screaming for an abstraction. It might be telling you there's a missing concept that hasn't been named yet. Either way, it deserves attention.

The places you avoid. Every codebase has modules that developers route around without consciously deciding to. When you notice yourself doing that — when you instinctively don't want to open a particular file — that avoidance is information. What specifically makes it uncomfortable? Is it the size? The coupling? The way it mixes concerns? Naming the discomfort is the first step toward a structural insight.

Change friction. Pay attention to which parts of the system require the most cognitive overhead to modify safely. If adding a new payment method means touching six files in three different layers, that friction is a pattern — a pattern of poorly bounded responsibility. The fix might look like a Strategy, or it might look like a simple consolidation. But you won't see it until you notice the friction first.

Reading Code Like a Craftsman

There's a useful analogy in the world of physical craftsmanship. An experienced woodworker doesn't look at a piece of lumber and immediately reach for a specific tool. They look at the grain, feel the weight, notice where the knots are. They develop a picture of what the material wants to become before they decide how to work it.

Code has grain too. It has natural joints and stress points. Some divisions feel clean; others feel forced. The developers who get genuinely good at architecture aren't necessarily the ones who've read the most books — they're the ones who've spent enough time reading their own code, slowly and honestly, to develop a feel for where it wants to go.

This is something you can practice deliberately. Set aside time — even thirty minutes a week — to read code you've already shipped. Not to fix it. Not to review it. Just to observe it. Ask yourself: what story is this code telling? Where does the story feel coherent, and where does it get muddled? What would a newcomer misunderstand?

When Pattern Names Become Useful

None of this means pattern vocabulary is useless. When you've felt the problem first — when you've sat with the friction and developed a clear sense of what's wrong — pattern names become powerful communication tools.

Saying "I think we need a Strategy here" in a design discussion means something when everyone involved can connect that name to a specific kind of problem they've encountered. It's a shared shorthand for a concept that would otherwise take five minutes to explain from scratch.

But the shorthand only works if it maps to a real felt experience. Otherwise it's just jargon — and jargon applied to problems it doesn't fit creates the over-engineered messes that the rest of us spend our careers untangling.

Sharpen the Eye, Not Just the Vocabulary

The goal isn't to stop learning patterns. It's to learn them in the right order: problem first, solution second. Feel the friction in your own codebase. Name what bothers you before you name the fix. Slow down long enough to read your code the way a craftsman reads their materials.

The patterns are already there. They emerge from real problems in real systems. Your job isn't to import them from a textbook — it's to develop the perception to find them where they live.

All Articles

Related Articles

Dead Comments Walking: How Stale Documentation Becomes Your Codebase's Biggest Liar

Dead Comments Walking: How Stale Documentation Becomes Your Codebase's Biggest Liar

What Did You Mean by 'data2'? Writing Names That Actually Survive the Night

What Did You Mean by 'data2'? Writing Names That Actually Survive the Night

Less Code, More Clarity: The Art of Subtracting Your Way to a Better Codebase

Less Code, More Clarity: The Art of Subtracting Your Way to a Better Codebase