Shape Suffixes – Good Coding Style

A tiny naming tip sparked a big "did we just reinvent old ideas?" comment war

TLDR: Noam Shazeer says programmers should add letter-based shape tags to variable names to make code easier to read and less error-prone. Commenters instantly turned it into a debate over whether this is a smart cleanup trick or just old programming habits, like Named Tensors and Hungarian notation, wearing fresh clothes.

A super-short coding advice post somehow turned into a full-blown comment-section identity crisis. AI researcher Noam Shazeer says programmers should add little letter tags to variable names so you can instantly tell a data blob’s shape at a glance. In plain English: instead of a vague name, you slap on a suffix that tells you what kind of rows and columns you’re dealing with. He says his team at Character.AI has used it since 2022, and the promise is simple: less confusion, fewer mistakes, and maybe, as he puts it, you’ll "feel saner."

But the real fireworks came from readers, who immediately asked: wait, is this actually new? One commenter said it felt a lot like PyTorch’s old "Named Tensor" experiment, basically suggesting the industry has been here before and already tried giving dimensions names. Another went even spicier, declaring, with a link to Hungarian notation, that tech has once again reinvented an ancient naming habit and is acting like it’s a breakthrough.

That’s the whole delicious tension here: supporters see a neat, practical trick for staying organized, while skeptics hear the ghost of old-school programming style rattling chains in the attic. The jokes practically write themselves: is this elegant clarity, or just retro office-label-maker energy for code nerds? Either way, the crowd reaction turned a tiny style note into a surprisingly juicy debate about whether Silicon Valley is innovating—or just cosplaying the past with better branding.

Key Points

  • The article recommends appending tensor variable names with suffixes that encode their dimensions and dimension meanings.
  • It says Character.AI has used this shape-suffix naming convention since 2022.
  • The method begins by defining documented single-letter symbols for logical dimensions, such as B for batch size and L for sequence length.
  • An example name given is `input_token_id_BL`, representing a tensor with batch and sequence-length dimensions.
  • The article includes incomplete, non-runnable Transformer example code to demonstrate consistent use of suffixes such as `hidden_BLD`, `logits_BLV`, and `query_BLHK`.

Hottest takes

"Named Tensor" experiment in PyTorch from a while ago
"reinvented hungarian notation from first principles" — voidUpdate
"Give it a try and let me know if you feel saner"
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.