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

A taxonomy Steve admits he invented over the weekend, posted for his Amazon coworkers before the paint was dry: the names are provisional, he isn't sure whether the last two styles are actually distinct, and he confesses he has never used STL, so readers are asked to write in and tell him where it belongs. The looseness is part of the appeal. Half of what he is documenting is sociology rather than software: allocation style as tribal identity, the machismo that keeps C programmers proudly twiddling bits (a farmer-dog-chicken-grain puzzle gets solved in raw bit masks to show how that life feels), buffer-and-pointer fluency as the only currency some interviewers will accept, and a cameo from the five years Steve spent at a company whose entire codebase — OS, libraries, applications, many of the tools — was 80x86 assembly.

One warning about the shape: the bottom four styles get the full guided tour, then the top two get a hurried sketch before Steve declares himself out of time and returns to his day job, which that week had him slogging through buffers and indices, a joke he makes at his own expense. The detours are where the essay pays for its length. Mid-tour he abruptly answers a question that had bugged him for years about why schools still teach linear and quadratic probing for hashtables, and his autopsy of the Java Iterator ("a poor-man's collection") will land with anyone who was writing collections code in 2005.

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.