← lore

Code Like Go

boring on purpose

⚠ warning: slop currently. Work in progress — not final.
Where minimalism starts
Minimalism starts, practically, by adopting the Go principles. Not a look. A hand position. Boring. Explicit. Small. This is where remove-to-accelerate hits the keyboard.

Why Go teaches

Go's ideology is that a language should stay small on purpose. Its designers put in only what all of them agreed earned its place, and left the rest out — less is exponentially more, as Rob Pike put it. Every feature omitted is one fewer way to say the same thing: one fewer decision at the keyboard, one fewer thing to argue about in review.

Go grew by subtraction. No exceptions. No inheritance. No generics for a decade. No ternary. No while. No implicit conversions. One code format, enforced by a tool. The designers kept taking knobs off until there was less to argue about. That's the trick. Go is the cleanest case of constraints as pedagogy we have: rm/acc applied to a language.

Go proverb
"Clear is better than clever."

Remove the clever option and you don't lose power. You lose the decision. The decision was the tax. Strip a function down to the Go shape and this is what remains:

// errors are values. you check them. that's it.
func ReadConfig(path string) (*Config, error) {
    data, err := os.ReadFile(path)
    if err != nil {
        return nil, fmt.Errorf("read config %s: %w", path, err)
    }
    var c Config
    if err := json.Unmarshal(data, &c); err != nil {
        return nil, fmt.Errorf("parse config: %w", err)
    }
    return &c, nil
}

No try/catch. No hidden path. The control flow is the source. Read top to bottom and you know what happens when the file is missing. That legibility is not an accident. It is what remains after the language kept saying no to anything that would hide the path.

Boring is the feature

Clever code is a loan against the next reader, usually you, six months later, wondering what idiot wrote it. Boring code pays cash. Slower to write, faster to live with. Go optimizes for the second number. That's the one that compounds. Staying small is the expensive path, not the lazy one — keeping a language simple takes more design than letting it grow.

Remove to accelerate. Fewer features, fewer ways to be wrong, fewer arguments, faster ships. The series below shows how Go does it and how to steal the discipline even if you're stuck somewhere else.

Pike's rules, 1989
The case is empirical, not aesthetic. Rule 1: "You can't tell where a program is going to spend its time" — so measure before you tune. Rules 3–4: "Fancy algorithms are slow when n is small, and n is usually small … use simple algorithms as well as simple data structures." Simple keeps winning on the numbers, not just on taste. — Rob Pike, Notes on Programming in C, 1989.

The series

1 · Subtraction as Pedagogy
What Go refused: exceptions, inheritance, ternaries, and the bug class each refusal killed.
2 · The Non-Negotiables
Errors as values. Zero value. Small interfaces. Composition over hierarchy. The rules left behind after the cuts.
3 · Habits That Travel
Accept interfaces, return structs. Table-driven tests. Channels and CSP. context all the way down. The idioms that hold up.
4 · Stories & Before/After
Where the discipline paid and where ignoring it burned. Real codebases, including this one.
5 · Nothing to Recover
Why Go needs no futures, how it solves what async/await solves, and what not to drag over from async-land.

Read it like this

Start at Subtraction if you want the case from the ground up. Jump to Patterns if you already buy it and just want code to steal. The throughline does not change: every Go choice is a removal that accelerated. Boring code beats clever code. Clear is better than clever.

The working checklist
The distilled version lives as a skill: kronael/tools/skills/go — the Go rules the agents here lint against on every commit. Patterns walks through it.

You see the same shape in real systems. Go — Why It's Fast makes the performance case; legibility is that same story from the other side. The codebases that survive under load read like Go: small interfaces, errors as values, no cleverness left to debug at 3am.

Start now
Write Rust and want the shortest path in? Walk Go from Rust — small lessons that map what you already know onto Go, one concept per file. Read one, predict the output, run it in the browser.