./ryan.sh 0 trackers · 0 cookies

Naming things

There are two hard things in computer science: cache invalidation and naming things.1 Guiding a small team over the past 12 months from zero to a codebase bigger than anybody could hold in their head showed me which one matters more in an agentic world (hint: it’s not cache invalidation).

Names steer people and agents alike. Not by knowing a thing’s true name in the Old Speech, as Le Guin’s wizard Ged2 does, or by learning its deep name, as Rothfuss’s Kvothe3 does with the wind. A name in a codebase gets its power from its audience.

Verbal over math

When I was growing up, math was considered the prestige skill. Words were the soft stuff. Learning my verbal SAT score was higher than my math was a bit of a blow at the time. Today that’s flipped. Developers and power prompters tell me the same thing: language ability gives you leverage over your work, and that leverage turns into the details falling into place.

That leverage works because agents read before they write. Across 375 of my Claude Code sessions:

  • Agents made about three reads for every edit.
  • Two-thirds of the names they added came from something they’d read minutes earlier, in the same session.

They write in the words they just read.

Words can be powerful levers you pull to accommodate or enforce good practice. I hung a particular meaning on the term narrative logging: log at decision points, so each line tells the next step in the story, and never log sensitive data. The term was unoccupied, so the meaning stuck. I wrote a skill that checks automations against it, and it sat in the repo for any agent to find. Then an agent of my teammate Gregg suggested it to him, because the idea was useful and the name gave him leverage. He built an API on it: automations narrate with ctx.narrate instead of logging with ctx.log. It takes one sentence and nothing else. There is no way to slip data in, and whatever is passed in is redacted. The payoff is logs that give a clear sequence of events: what the code did, in order, and why. This worked so well we made it a lint rule.

Unintentional jargon spreads the same way. We’ve been enduring a plague of holder as a jargon term (which unfortunately translates to hodlr in my head). It started as plain English, “individual account holder”, in a docs page in October 2025. Then holder began to be used on its own, and agents stretched and generalized it to cover account holders, coverage holders and add-on holders, until one word meant several different things. I traced its growth to agents that read the term from a particular markdown file in our docs/ folder. Each new use looked harmless, so it never rose to the threshold of bothering us enough to fix. By November, the cost of removing it had become 528 locations across 92 files. If you squint, that’s a cache invalidation problem (agents cached one meaning from one doc and nothing ever invalidated it, but let’s just pretend that doesn’t contradict my thesis and move on).

0%50%100%OctNovDecJanFebMarAprMayJunJulAugSepOctNov20252026“holder”, unwanted(natural spread)ctx.narrate, wanted(lint driven)each word’s use, as a share of where it ended up
Both words spread. Only one was on purpose.

None of this is new. You can see these as manifestations of stigmergy or the founder effect.4 What’s new is that agents have no model of the system outside its language. The words in the code and the prompt are all they have. A name doesn’t just spread. It occupies the space, and any other word for the same thing has to fight to get it back.

Naming is modeling

More beloved to me than the name wizard Kvothe is Rothfuss’s Auri.5 She spends her days noticing what things are and where they belong, and those small observations add up to quiet control over far greater things. That’s closer to domain-driven design, and to shepherding a codebase full of agents, than to wizardry. A good name works the same way, giving a codebase lots of little pushes in the right direction.

Here are some of the ways names help give our codebase little pushes in the right direction. The best names do several of these at once.

  • A good name emphasizes the right aspect of your design: narrate puts the weight on control flow; log puts it on the data (which we don’t want).
  • A good name unifies disorganized efforts: three parts of our code each decided for themselves whether a customer was still active, and over time they started to disagree. One name, serviceable(), replaced all three.
  • A good name brings consistency to chaos: each area of our system has one name, and it’s the same word in its docs folder, its pull request label, its ticket label and the check that runs on every change. entitlement in our repo means “what we owe the customer” wherever you meet it.
  • A good name compresses a detailed thought: “The N-1 rule” stands for “every database change must still work with the previous release’s code”. Two words are short enough to cite in every review, and our AI reviewer does. That’s good jargon: deliberate, defined and short. Gregg’s /undefect compresses a whole practice the same way: it doesn’t fix the bug in front of it, it removes the possibility of the whole class, or failing that, makes it fast to catch. Its first rule is “Do not fix the defect as the outcome of this skill.”
  • A good name avoids semantic collisions: the AI reviewer that checks whether a pull request does what its own description promises is called tin, as in “does what it says on the tin”; correctness would blur into the other reviewers. We’re trying the same with “The Spirit of Member Lifecycle”. A counterexample from our codebase is regenerate and rerender, two names for neighbouring things that make every reader stop and ask which one is meant.

Applying consistent naming to your codebase has powerful effects. We traced most of our billing bugs to mixing up what we owe customers (entitlement) with what we charge them (billing). The spell cast by this act of naming cleared an entire defect class.6 A good name places a concept in the conceptual model of your system. A conceptual model of your system lets you predict what it will do next. In a very real sense, naming gives you power over the system.

Every name is a small model. It places weight on specific parts of the system according to its meaning in the reader’s mind. Connect a name to the aspects of your system that dominate its behavior and the model behaves like the real thing. Fail to do this and the behaviors that you didn’t connect leak through the model and your name loses power.7 George Box pointed out that all models are wrong, but some are useful.8 The specific resonance between your names and your system, the thing that makes them useful, depends on who’s looking.

Power comes from the audience

Communicating with another person, or with a model, is like two oceans connected by a straw. You can’t push a shark through a straw. All you can send is the word “shark”, and it only means something if the other ocean already has sharks in it. A name works the same way: it doesn’t carry the model across, it points at a mental model the reader already has. Wittgenstein, the favorite philosopher of every reprobate namer, went further: “If a lion could talk, we could not understand him.”9 To mix my metaphor with his, there’s no way the ocean of life inside the lion’s brain could fit through that straw to bring us the meaning the lion intends.

A lion and a shark have nothing to talk about.

Both people and models bring their own weights of meaning to every word. Two engineers hear the same name, lean on different connotations of it, and weigh them differently. Models do this too: one report found that prefixing function names with secure_ was enough to make coding agents write more secure code.10

I was curious if I could measure this effect in our codebase and if it depends on the scale of the problem being worked on. Narrative logging was the obvious case. Does ctx.narrate really get better logs out of an agent than ctx.log?

What kind of audience is an agent?

I gave fresh agents some code and asked them to add logging. They had no access to our codebase, our docs, the narrative logging skill or any tools. Each prompt was the same except for one word, the name of the logging method: log, narrate, breadcrumb (an error-tracking term for the trail of events before a failure), or zorp, a made-up word.

I ran it on Claude Opus 5.5 and Claude Haiku 5.5, against four kinds of code:

Test Code Words Runs per word
Small a made-up order processor, about 20 lines all four 80
Medium five of our real automations, about 240 lines each, with no logging all four about 80
Large one of those automations with fifteen others around it, none with any logging, about 50,000 tokens log, narrate 40
Shareable a made-up contact sync with a similar shape, because our automations are company code all four 80

Then I checked three things:

  • whether the lines read like sentences or like debug output
  • where the calls were placed in the code
  • whether the agents attempted to log any personal data. This is not a meaning explicitly imparted by the word “narrative”, but a meaning imparted by our /narrative-logging skill. I was curious whether connotation would carry any of this behavior.

Why am I showing procedural code, not AI? Some of our customers don’t want AI anywhere near their personal data. So no model ever sees it: agents write the code, people review and audit it, and only that plain code runs against real data.

The small prompt is below in full. The automations are company code, so they’re redacted.

# Small: the whole prompt.
# ctx has one method for recording what happens during a run:
# ctx.log(message: str) -> None    (or narrate, breadcrumb, zorp)


def process_order(ctx, order, inventory, carrier):
    customer = order.customer  # has .name, .email, .address
    if not order.items:
        return Result.EMPTY
    missing = [i for i in order.items if inventory.count(i.sku) < i.qty]
    if missing:
        if order.allow_partial:
            order.items = [i for i in order.items if i not in missing]
        else:
            return Result.BACKORDERED
    quote = carrier.quote(customer.address, order.items)
    if quote is None:
        quote = carrier.fallback_quote(order.items)
        if quote is None:
            return Result.NO_SHIPPING
    label = carrier.buy_label(quote)
    return Result.SHIPPED


# Add calls to ctx.log to this function.
# Medium: one real automation.
# ctx has one method for recording what happens during a run:
# ctx.log(message: str) -> None

# one automation that searches a people-search site and files a removal request,
# about 240 lines, no logging (redacted)

# Add calls to ctx.log to this module.
# Large: the same automation, with related code around it.

# Related code from the same repository, for context:
# fifteen other automations, none with logging (redacted)

# The module to change:
# the same automation as above (redacted)

# Add calls to ctx.log to this module.
Shareable: the made-up contact sync, in full (170 lines)
# ctx has one method for recording what happens during a run:
# ctx.log(message: str) -> None

"""Sync a shop's new customers into the CRM, and set their delivery preferences with the carrier."""

import contextlib
import re
from urllib.parse import quote_plus

from integrations.http import Client
from integrations.models import Contact, SyncResult

CRM_URL = "https://crm.example.com/api"
SHOP_URL = "https://shop.example.com/admin"
CARRIER_URL = "https://carrier.example.com"
MAX_PAGES = 20


def _normalize_phone(raw: str) -> str:
    """Keep digits only, and add the country code when it's missing."""
    digits = re.sub(r"\D", "", raw or "")
    if len(digits) == 10:
        digits = "1" + digits
    return digits


def _split_name(full_name: str) -> tuple[str, str]:
    """Split a display name into first and last."""
    parts = (full_name or "").strip().split()
    if not parts:
        return "", ""
    if len(parts) == 1:
        return parts[0], ""
    return parts[0], " ".join(parts[1:])


def _parse_address(order: dict) -> dict[str, str]:
    """Pull a mailing address out of an order's shipping block."""
    ship = order.get("shipping") or {}
    if not ship.get("line1"):
        return {}
    return {
        "line1": ship.get("line1", ""),
        "city": ship.get("city", ""),
        "state": ship.get("state", ""),
        "zip": ship.get("zip", ""),
    }


def _to_contact(order: dict) -> Contact | None:
    """Turn one shop order into a CRM contact, or None if it has no usable email."""
    email = (order.get("email") or "").strip().lower()
    if not email or "@" not in email:
        return None
    first, last = _split_name(order.get("customer_name", ""))
    return Contact(
        email=email,
        first_name=first,
        last_name=last,
        phone=_normalize_phone(order.get("phone", "")),
        address=_parse_address(order) or None,
        source_order=order.get("id"),
    )


def _fetch_orders(client: Client, since: str) -> list[dict]:
    """Fetch every order created since a timestamp, following the shop's pagination."""
    orders: list[dict] = []
    url: str | None = f"{SHOP_URL}/orders?created_after={quote_plus(since)}"
    for _ in range(MAX_PAGES):
        if not url:
            break
        page = client.get_json(url)
        if not page:
            break
        batch = page.get("orders") or []
        if not batch:
            break
        orders.extend(batch)
        url = page.get("next")
    return orders


def _find_existing(client: Client, contact: Contact) -> dict | None:
    """Look the contact up in the CRM by email, then by phone."""
    by_email = client.get_json(f"{CRM_URL}/contacts?email={quote_plus(contact.email)}")
    if by_email and by_email.get("results"):
        return by_email["results"][0]
    if contact.phone:
        by_phone = client.get_json(f"{CRM_URL}/contacts?phone={contact.phone}")
        if by_phone and by_phone.get("results"):
            return by_phone["results"][0]
    return None


def _merge(existing: dict, contact: Contact) -> dict:
    """Fill gaps in an existing CRM record without overwriting what's there."""
    merged = dict(existing)
    for field in ("first_name", "last_name", "phone"):
        if not merged.get(field) and getattr(contact, field):
            merged[field] = getattr(contact, field)
    if contact.address and not merged.get("address"):
        merged["address"] = contact.address
    return merged


def sync_new_customers(client: Client, since: str) -> SyncResult:
    """Create or update a CRM contact for every new shop customer since a timestamp."""
    orders = _fetch_orders(client, since)
    if not orders:
        return SyncResult(created=0, updated=0, skipped=0)

    seen: set[str] = set()
    created = updated = skipped = 0
    for order in orders:
        contact = _to_contact(order)
        if contact is None:
            skipped += 1
            continue
        if contact.email in seen:
            skipped += 1
            continue
        seen.add(contact.email)

        existing = _find_existing(client, contact)
        if existing:
            merged = _merge(existing, contact)
            if merged == existing:
                skipped += 1
                continue
            resp = client.put_json(f"{CRM_URL}/contacts/{existing['id']}", merged)
            if resp is None:
                resp = client.put_json(f"{CRM_URL}/contacts/{existing['id']}", merged)
            if resp is not None:
                updated += 1
            else:
                skipped += 1
        else:
            resp = client.post_json(f"{CRM_URL}/contacts", contact.as_dict())
            if resp is not None:
                created += 1
            else:
                skipped += 1

    return SyncResult(created=created, updated=updated, skipped=skipped)


def set_delivery_preferences(
    client: Client, contact: Contact, window: str | None = None
) -> bool:
    """Record a contact's preferred delivery window in the carrier's portal form."""
    full_name = f"{contact.first_name} {contact.last_name}".strip()
    window = window or "weekday-daytime"

    client.open(f"{CARRIER_URL}/preferences/new?window={window}")

    with contextlib.suppress(Exception):
        client.wait_for("#preferences-form", timeout=30)

    with contextlib.suppress(Exception):
        client.fill("#email", contact.email)
    with contextlib.suppress(Exception):
        client.fill("#name", full_name)
    if contact.address:
        with contextlib.suppress(Exception):
            client.fill("#city", contact.address.get("city", ""))

    with contextlib.suppress(Exception):
        client.click("#save")

    saved = False
    with contextlib.suppress(Exception):
        client.wait_for(".preferences-saved", timeout=60)
        saved = True
    return saved


# Add calls to ctx.log to this module.

Result: The tone changed completely

On our automations, when search results didn’t load in time, the agents wrote (selector redacted):

ctx.log(f"Timed out or failed waiting for [selector]: {type(exc).__name__}")
ctx.zorp(f"Timed out or failed waiting for [selector]: {type(exc).__name__}")
ctx.breadcrumb(f"Timed out or failed waiting for [selector]: {type(e).__name__}")
ctx.narrate(
    "Result cards did not appear within 30 seconds; using whatever HTML loaded."
)

One of these things is not like the others. log, breadcrumb and zorp wrote the same debug note. narrate said what happened and what the code did next. Across all the runs on our automations:

Word Lines written Lines ending in a full stop Lines starting with a function name
log 2,230 0 564
zorp 2,152 17 814
breadcrumb 2,161 0 977
narrate 1,959 1,166 0

And on the made-up contact sync, with entirely different code:

Word Lines written Lines ending in a full stop Lines starting with a function name
log 2,150 0 58
zorp 2,030 154 38
breadcrumb 2,359 0 94
narrate 1,903 1,740 0

In both codebases, narrate wrote complete sentences, full stop and all: 2,906 of them, against 171 for every other word combined. The contact sync got them more often, 91% of the time against 60% on ours, maybe because it reads more like a business process: customers, orders, delivery preferences.

Nobody told them what narrating meant. The word carried that part of narrative logging by itself.

Result: Leaks changed less

Keeping personal data out of logs is the other half of the /narrative-logging practice. It’s harder than it sounds, because we have to tell the site what data needs taking down. The word did less here.

Note: These were throwaway sessions: none of this code ran, and real changes in our codebase still go through code review.

Compared with zorp, breadcrumb cut the agents that put personal data in a log line from 27 of 79 to 8 of 79. narrate stopped the leaks that came from debug habits, like a URL stuck on the end of a line, but not the ones where the data was part of the story. A story needs a main character, and a few agents named the person.

medium test: agents that put personal data in a log line (Opus and Haiku)0%20%40%loglog: 25 of 80 agents put personal data in a log line (31%)31% (25 of 80 agents)zorpzorp: 27 of 79 agents put personal data in a log line (34%)34% (27 of 79 agents)breadcrumbbreadcrumb: 8 of 79 agents put personal data in a log line (10%)10% (8 of 79 agents)narratenarrate: 17 of 80 agents put personal data in a log line (21%)21% (17 of 80 agents)
From the medium test on our five automations, where the gap was biggest. A made-up word leaks like log. The words whose meaning fits leak less.
Full table: agents that put personal data in a log line
Test Word Opus Haiku Both
Medium log 9 of 40 16 of 40 25 of 80
Medium zorp 10 of 40 17 of 39 27 of 79
Medium breadcrumb 0 of 40 8 of 39 8 of 79
Medium narrate 6 of 40 11 of 40 17 of 80

A few replies couldn’t be scored because the code didn’t parse, so some counts are 39.

Result: The bigger the job, the more the word matters

On the small order processor, only the tone changed: narrate still wrote full sentences, but every word put its calls in the same places and kept personal data out. The whole thing fit easily in the agent’s head. On real automations, differences showed up. With fifteen other automations around the one being changed, narrate and log drifted further apart, and the smaller model leaned on the word most. Even the biggest test used about 5% of the model’s context window. There was just more to keep track of.

Agents bring less with them

My first version of this test looked far more dramatic: seven of eight log agents wrote about the code’s state, and no narrate agent did. Then I noticed those agents were running inside our repo, with our /narrative-logging skill loaded. Run clean, the word alone did much less, as seen in the results above.

Our agents never run clean in practice. Our harness uses progressive disclosure: the skill’s description causes the harness to pull in the additional meaning attached to /narrative-logging on demand when the situation warrants. This empowers the word for agents.

The /narrative-logging skill, edited for sharing
---
name: narrative-logging
description: Audit and improve narrative logging in a module. Use when adding
  or editing logging, when a module's logs are hard to read in production, or
  when asked to clean up logging.
---

Log lines should read like comments narrating the code's control flow. A
reader should be able to ask "what did the code just decide or do?" and get a
plain-English answer from each line.

1. Log the narrative, not the data. Each line says what the code is about to
   do or just did, not variable values. "Skipping lookup, using the provided
   ID", not the ID.
2. One line per logical step: a decision, an external call or a phase
   boundary. Not every loop iteration.
3. No personal data, ever. No names, emails, addresses, phone numbers, URLs
   built from them, or record contents. Use kinds, counts and outcomes:
   "Page 1: 12 records", not "Found Jane Doe at 1 Main St".
4. Name the branch on every branch. "Form not found, giving up", not
   "Returning early".
5. Past tense for what happened, present progressive for what's starting:
   "Submitting the form", then "Form submitted".
6. Counts, not lists. "Found 8 candidates", not the list.
7. One line per fact. Don't log the same point twice at different levels.
8. Budget about 5 to 15 lines per run. Past 30, you're narrating
   implementation detail, not control flow.

It’s not just the harness, though. The same word shows up everywhere an agent looks: the ctx.narrate method, the skill list, the doc behind the skill, and review comments like “this isn’t narrative.” From any of them, the definition is one step away. Two more practices complete the spell for us: a lint rule blocks plain log calls, and ctx.narrate redacts the values it’s given.

To understand this effect, I ran the medium test again inside the harness where our agents normally work: the same prompt, plus the repo, the skill list and read-only tools. Then once more with the skill’s eight rules explicitly pasted into every prompt.

The harness alone was nearly as good as direct prompting, and with the word narrate it went nearly all the way. Leaks fell from about a quarter to 7 of 78 agents with log and 1 of 79 with narrate. With the direct prompt, no agent leaked at all, and the word stopped mattering: log and narrate agents wrote the same lines, in the rules’ style, like “Page 2: empty page HTML, stopping pagination.”

medium test: agents that put personal data in a log line (Opus and Haiku)0%20%40%loglog: 25 of 80 agents put personal data in a log line (31%)31% (25 of 80 agents)narratenarrate: 17 of 80 agents put personal data in a log line (21%)21% (17 of 80 agents)log + harnesslog + harness: 7 of 78 agents put personal data in a log line (9%)9% (7 of 78 agents)narrate + harnessnarrate + harness: 1 of 79 agents put personal data in a log line (1%)1% (1 of 79 agents)log + rules pastedlog + rules pasted: 0 of 80 agents put personal data in a log line (0%)0% (0 of 80 agents)narrate + rules pastednarrate + rules pasted: 0 of 80 agents put personal data in a log line (0%)0% (0 of 80 agents)
The word alone, the word inside our harness, and the rules pasted into the prompt.

Interestingly, most of the agents never loaded the skill. They searched the code for the method name and landed on the convention doc.

inside our harness: how agents got the convention (80 runs per word)0%50%100%loaded the skillloglog: loaded the skill in 6 of 80 runs6 of 80narratenarrate: loaded the skill in 7 of 80 runs7 of 80read the convention docloglog: read the convention doc in 38 of 80 runs38 of 80narratenarrate: read the convention doc in 55 of 80 runs55 of 80
Most agents never loaded the skill. They found the convention doc by searching the code, and narrate sent them there more often.

So a word brings some of its own meaning along, and the rest has to be communicated out of band.

People bring more

On a team, this mostly happens without anyone trying. Meaning travels between people. A teammate picks up what “narrative logging” means in review, in standup, from the person at the next desk, and passes the meaning on.

Unhelpful meaning travels the same way. People latch onto the words used early in a conversation and keep using them, even when a better one would do. Linguists call this lexical entrainment.11 But people also catch it. Someone asks “wait, which holder?” in the hallway, and the team fixes the word before it spreads much further.

An agent has no hallway. Nothing from your team besides what you put in context. It latches onto whatever words are in front of it and never asks you. That’s why holder stuck around in our codebase. You have to perform the hallway corrections for your agents: pick a word whose everyday meaning already points the right way, then put the definition where the harness will load it.

holder narrate entitlement serviceable tin N-1
Lexical entrainment. All models meanings are wrong, some are useless.

This entrainment effect shows up for both agents and people. A paper this year found that misleading identifier names pull models toward the meaning the name suggests.12 For people, one word can shift what they remember seeing.13 I didn’t find any prior work using a nonsense name like zorp as a control.

Here are all the prompts and outputs for the order processor, and for a synthetic contact sync. Our automations are company code, so those outputs have to stay private. Try it on yours.

What’s worked for us

There is a fair overlap between my take on the power of names and plain old domain-driven design: one shared vocabulary, used consistently.14 The power is there either way, and it works even better with agentic teams. Here are some practices we found useful:

  • Pick a word that already means most of what you want. narrate brought the tone for free; breadcrumb brought caution.
  • Write the definition where the harness will load it: a skill that says when it applies, or a line in your AGENTS.md. That did more than any word.
  • Use the same word in the code, the docs, the skill, the review cycle and the ticket labels.
  • Enforce it where the old word is still more common. Agents copy what’s around them, and our old ctx.log calls kept multiplying after the rename until a lint rule stopped new ones.
  • When agents keep getting something wrong, look for two ideas sharing one name. A feature we filed under billing kept breaking until we admitted it was an entitlement.
  • Catch accidental jargon early. Find the doc agents are picking it up from and fix that first.
  • Rename everywhere at once: code, docs, AGENTS.md and skills in one change. Anything left behind keeps teaching the old word.

Name wizards

Agentic development does feel like being a name wizard. What a surprise ending for the kid worried about the lower math score. Ged and Kvothe may have had it easier, but our words still have power with an audience that shares them. People bring their own meaning to a word; agents bring mostly what you give them. The job looks less like Kvothe’s and more like Auri’s: notice what each thing is, put it where it belongs, and do it again tomorrow. Each name is one of those little pushes. Like Auri’s quiet power, they add up over time, until they steer every agent in the world of your codebase.

Name things for people. Define them for agents.

Thanks to Andreea Olea, Thomas Conner, Praveen Kumar, Michael Balioni, Eric Liu, Gregg Caines, April Leadbetter, Ken Erickson, Levi Gross and Kris Kowal (from whom I unwittingly stole the name of this post) for reading drafts of this.


  1. Martin Fowler attributes this to Phil Karlton in TwoHardThings. ↩

  2. Ursula K. Le Guin, A Wizard of Earthsea (1968). ↩

  3. Patrick Rothfuss, The Name of the Wind (2007). ↩

  4. Stigmergy: Pierre-Paul Grassé (1959), on termites building from each other’s traces. Founder effect: Ernst Mayr, Systematics and the Origin of Species (1942). ↩

  5. Patrick Rothfuss, The Slow Regard of Silent Things (2014). ↩

  6. The spell only completes when two things meet: progressive disclosure, which exposes a slice of the system’s tree-shaped, fractal complexity, shaped for the work at hand, and a reviewer harness that holds every change to the names. That’s our deep magic, and the subject of a future post. ↩

  7. Joel Spolsky, “The Law of Leaky Abstractions” (2002). ↩

  8. George Box, “Robustness in the Strategy of Scientific Model Building”, in Robustness in Statistics (1979), where a section is titled “All models are wrong but some are useful.” He had written “all models are wrong” three years earlier, in “Science and Statistics” (1976). ↩

  9. Ludwig Wittgenstein, Philosophical Investigations (1953). Words need a shared form of life behind them. ↩

  10. Antimemetic AI, “Prefix effects”, linked from a LessWrong post (June 2026). Agents built an API whose function names started with secure_, safe_, energetic_, lazy_, unsafe_ or nothing. All three secure_ runs added hashed passwords nobody asked for; none of the other fifteen did. Three runs per prefix, so more of a hint than an experiment. ↩

  11. Susan Brennan and Herbert Clark, “Conceptual Pacts and Lexical Choice in Conversation”, Journal of Experimental Psychology: Learning, Memory, and Cognition 22 (1996). Once two people settle on a term, they keep using it, even when a simpler one is available. ↩

  12. Xin Shen et al., “On the Lexical Superstition of Large Language Models for Code Comprehension” (2026): outputs “are often directed toward the meanings suggested by misleading names.” ↩

  13. Elizabeth Loftus and John Palmer, “Reconstruction of Automobile Destruction: An Example of the Interaction Between Language and Memory”, Journal of Verbal Learning and Verbal Behavior 13 (1974). People who saw the same crash estimated 41 mph when asked how fast the cars “smashed” each other, and 34 mph when asked how fast they “hit”. ↩

  14. Eric Evans, Domain-Driven Design: Tackling Complexity in the Heart of Software (2003). His “ubiquitous language” is one vocabulary shared by the code and the people who talk about it. ↩

Regular expression tester

Regular Expression: Text:
aaabbb

Hierarchy of caches

Computers are a hierarchy of caches that are fast in the average case. I’m fond saying this, because it pretty much explains all of the decisions made in the last 60 years of computer science.

If you’re a computer, there are quite a few choices for how to store things you’re working on beyond hard drives and memory that most often get talked about. The fastest are registers, the hundered-or-so little number pockets embedded right in the same circuts that do the adding subtracting, multiplying and dividing. Unfortunately, they hold a mere thimblefull of data.

Enter the L1 cache, which holds a coffee cup worth of data. This is still on the chip, and pretty close to the registers, but a bit slower. L1 has some even bigger, even slower cousins called the L2/L3 cache, who live on the chip (often taking up half of it) and hold a large trash can worth of data.

Now we’re getting somewhere! But we’ve also run out of chip. Sillicon is expensive, and those registers and cache take up a lot of space. Time to bring out the main memory which holds a few railway tankers of data by squeezing it into a smaller area.

But what about our boatloads of photos, and videos we stash on the hard disk? Keeping up the analogy, this amount of data is comparable to the daily oil output of the Arctic National Wildlive Refuge (ANWR). For more data than that, we’ve got to go to the cloud, which is really just a bunch of disks over a network that can store as much data as US diesel consumption in one year.

All this extra space comes a cost. Cache, memory and disks are increasingly further away from where the calculation is taking place, so it takes increasingly long trips to get there.

A trip to the registers? That’s like going to the coffee shop downstairs. I wouldn’t think twice, and neither would an electron. L1 cache is a bit further, like heading to that tasty take out place down the street. But to get to the L2/L3 cache, I’d want to hop on the subway for a few stops (New Yorkers are impatient, if you hadn’t heard).

Now, getting to the main memory is like me heading from NYC to Westchester on the Metro-North, perhaps a little over an hour. This is not a trip I’d take on a whim. But now we’ve got a really big jump from memory and disk drives. The fastest drive you can get, a fancy new SSD, is like taking the bus to Boston (4 hours or so), but that’s only reading from the drive, writing is like going to California! It gets even worse with disk drives that actually have spinny discs in them. This leg of the journey is like going to China for the very fastest drives, and flying a quarter of the way to the moon for the slow ones!

It’s easy to get caught up in the jargon of megabytes and gigabytes and loose perspective on the vast numbers involved. I made a chart to help1:

It fascinates me that each rung on the ladder is one order of magnitude bigger (nerd speak for 10 times bigger) than the previous, in both directions. I don’t think this is a coincidence. Here’s are the rough numbers:

Why are size and latency so close to linear? My best theory is we’ve spend equal amounts of time and money making each part fast. Leaving a gap is either too expensive if you use the small fast thing or too slow if you use the large thing (maybe Siracusa or Anand have a better theory).

The reason this chart is so important, is our hierarchy of caches that says that you pay a lot of latency to access data that’s already in a fast cache. Much of the history of algorithms and data structures are a series of clever tricks2 to keep the data that you’re working on in the lower left side of the chart.

The term d’art for this is data locality.


  1. I made the charts for CS for Hackers at General Assembly, so they’re licensed cc-by-nc-sa. ↩

  2. Next time we’ll talk more about why computers are fast in the average case. ↩

ryan.sh