2 min read

The Architecture of Thought

How structuring code taught me to structure ideas. Notes on mental models, abstractions, and the beauty of well-named things.

Programmers spend their days building structures. Not physical ones — conceptual ones. We take a messy, ambiguous problem and give it shape: modules, functions, types, hierarchies.

Naming Things

Phil Karlton famously said there are only two hard things in computer science: cache invalidation and naming things. He was right about the second part — but what he didn't say is that naming is hard because it's thinking.

When you name a function calculateTotalWithDiscount, you've made a decision about:

  • What the function does (calculates)
  • What it operates on (a total)
  • What variation it handles (with discount)

A good name is a compressed thought. It carries meaning without requiring the reader to unpack the implementation.

Abstractions as Ideas

The same skill applies to writing. An essay is an abstraction over a cloud of thoughts. A paragraph is an abstraction over several related sentences. A sentence is an abstraction over a single idea.

// Code structure mirrors thought structure
Module → Section
Function → Paragraph
Variable → Sentence

When the structure is right, both code and prose become easier to navigate. When it's wrong, you feel lost — even if every individual piece is correct.

The Beauty of Refactoring

I once spent three days refactoring a module. The behavior didn't change at all. From the outside, nothing was different. But inside, the code had gone from something I tolerated to something I understood.

That's what refactoring is: not changing what the code does, but changing how it thinks. The same applies to rewriting a draft. You're not changing the argument — you're changing its clarity.


Structure is invisible when it works and obvious when it doesn't. The best architecture — whether in code or in thought — is the kind you don't notice until it's gone.