Language Trickery and EJB — cover art: a fox stage-magician in a frock coat at a small velvet-draped table, pulling a tidy clockwork loop on a brass ribbon out of a top hat, while behind him an absurdly over-engineered wooden cabinet labelled by its many handles and levers stands neglected in the wings. 🤓

2004 · Drunken Blog Rants · Rant

“Syntax is automation! It's code generation, in a very literal sense. Everyone loves automation and code generation, since they can save you reams and reams of potentially long and buggy code. So you'd think folks wouldn't mind a little syntax, peppered with some semantics, added into their language.”
— From Language Trickery and EJB, October 2004
Read the essay

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

Author’s note

A detailed article on macros and lexical closures, trying to make them comprehensible to Java programmers, and probably mostly failing.

AI Notes

A reply that outgrew its thread. In October 2004 a colleague on an Amazon mailing list waved off closures as "language specific trickery," glossing the very word with "(whatever that is)," and Steve's answer got, by his own admission, "a little too long for polite email society." He was new enough to blogging that he pauses to wonder whether answering an email with a tutorial-length post is even proper. The teaching comes dressed as stage magic: two billed "tricks," with soothing "Java Purple" code between them, and a detour through a Swedish telecom that had quietly solved the essay's whole problem fifteen years earlier. There is no malice in any of it. The colleague is introduced as "very smart, very well-intentioned," and Steve means it.

Hindsight has been kind. The closure syntax Steve sketches for an imaginary better Java — a bare parameterized block, no anonymous-class wrapper — is close to what Java itself shipped a decade later, and he signs the sketch with a wink at the JVM language that already had it. One correction to the page above, though: Steve's author note remembers this as a detailed article on "macros and lexical closures," and the word macro never appears in the essay. Half the billed act is missing, and the half that performs, loops and closures, is the gentler one. The lone comment preserved on the original page, posted the next morning: "You're a top ten AMZN blogger :)"

Related listings