Allocation Styles — cover art: a small mole librarian in a tweed waistcoat standing in a Victorian library, holding a slim ledger, with six labelled storage vessels on a shelf behind him — a tiny brass capsule, a wooden crate, a deep wicker basket, a long beaded string, a card-catalogue drawer, and a glass jar of pinned moths — each one a different way to hold the same data. 👍

2005 · Drunken Blog Rants · Rant

“I think good programmers make intelligent choices about allocation styles. And I think the intelligent choice is to use the most expressive style you can get away with — let your profiler tell you if you need to step down a level.”
— From Allocation Styles, April 2005
Read the essay

© 2005 Steve Yegge. Originally published at Drunken Blog Rants.

Author’s note

This is a gargantuan post, but I enjoyed re-reading it in 2026. It views programmers and programming languages through the lens of how they think about allocating memory as they work. It turns out to be astoundingly nuanced, and sits at the center of language design, programming styles, and expressiveness/resilience tradeoffs.

The post is not for the faint of heart. You probably have to be a hardcore programming languages nerd in order to make it to the end.

AI Notes

Written April 2005 from inside Amazon's C++ codebase. Programmers, Steve notices, talk about languages in terms of paradigm — imperative, functional, declarative — but the more predictive axis, the one nobody has named, is how the programmer thinks about memory. He names it allocation style, and counts six of them: allocation-free, buffer-oriented, collection-oriented, list-oriented, query-oriented, pattern-match. Each gets a tour — the languages it feels native in, the tell-tale signs in code review (double-pointers, explicit length params, heavy memcpy), the trade-off between expressiveness and control. The bit everyone remembers is the Ruby/Java string-reflection example: one Ruby line ("".methods.sort.grep(/!/)) versus ten lines of Java grind — a point about the ceiling each language puts on the styles you can naturally reach, not its syntax.

The closing turn is the line that aged: use the most expressive style you can get away with; let the profiler tell you when to step down. Twenty years later the six categories still describe production code accurately — only the ratios have moved — and the advice is still one most programmers haven't taken, because most inherit the style their first language taught them, mistake it for good engineering, and spend years cutting against the grain of whatever they are paid to write.

Related listings

  • 2005

    Is Weak Typing Strong Enough?

    Same drunken-rant move applied to a different axis. Weak Typing is about the type system you inherit from your first language; Allocation Styles is about the memory model. Both end with the same advice: stop confusing your first idiom for the right one.

  • 2006

    Math For Programmers

    A year later on the Blogspot side, Steve makes the parallel argument for math literacy — climb as high as you can and step back down only when you must. Same shape of argument, different dimension.

  • 2005

    Lisp Wins (I Think)

    The Lisp piece is the practical sequel — once you accept that you should program as high as the problem allows, Lisp is the rung that keeps refusing to be displaced.