Ruby Gem Naming: The Art of Delightful Obscurity
- 4 minutes read - 733 wordsThe Ruby community was always marked by an especially playful character. I haven’t written Ruby in over 5 years, but I still remember that feeling of play. It always surfaced in the oddest moments where someone would go off on a tangent and you could see the humorous stinger coming from a mile off and then you’d think: “Wait, they’re going exactly were I thought they might be going with this.”
A notable moment was when David Brady noticed the irrepressible urge of Rubyists to misdirect so that they could land a joke once you resolved the cryptic crossword-like clue of the naming algorithm:
Avdi: I’m working on a gem [a library] called
gem-love
[Other conversation happens]
David: I literally design around…[the question of names including “-” or “_” confusion]…by only using one word. And so, Avdi, I would have recommend that you rename your gem to
glove
. [Laughter]David (continues): However, there is a cultural thing in the Ruby community that you must give your name just a weird ass freaking name that is surprising but inevitable. It’s like, before you hear the gem name, you should have no idea how to intuit the name of the gem. No way to predict it. But once you hear it, it should make sense. It’s the opposite of intuitive. So, your gem name Sir,
isotoner
.
After some laughter, James puts a capstone on the idea:
JAMES: [A] lot of languages, you have your extensions or whatever, your libraries being called something like
XML::Parser
, or whatever where it’s very self-descriptive. In Ruby, we don’t like that. We like the creative,Nokogiri
means chainsaw…
Hearing James say this, I immediately worked out the chain…
Nokogiri
works on structured text documents →
Structured text documents are represented as document trees →
Chainsaws work on real trees →
The library to pick apart document trees is the Japanese word for “chainsaw.”
And for bonus points:
Nokogiri
is also the name of a mountain range that has, a serrated appearance like…a chainsaw.- Hang on a second, I just did it myself. Serration comes from Latin “serratus” meaning, notched like a saw. And oftentimes in Latin literature mountains are described as being like “serra.” You might know this word, of course in its Spanish form, especially if you’re from California: Sierra.
Like David said: “surprising…but inevitable.”
While any sane non-dork would have run screaming from this discussion, Rubyists would be snickering and celebrating the joyful series of misdirections here (no surprise that Monty Python humor has always been a dork-unifying banner).
It’s not entirely surprising that this was the case, the hackers behind Smalltalk and Lisp, Ruby’s intellectual codon-donors, always had a sense of irreverence.
And while most programming interviewers will be agog if you say either is your preferred programming language, all programmers know that those who truly understand either are better-than-average lunch partners, interesting pair programmers, and the kind of folks who can drop a double-indirection reference soup joke that leads the mentally nimble interlocutor to a humor Easter-egg (humor egg-drop soup, then).
Some programming languages seem to encourage this kind of creativity, while others feel actively hostile to it. Ruby’s community embraced, in my time, the absurd and the clever in equal measure.
In our increasingly utilitarian world of software development, where everything must be immediately parseable and optimized for search engines – or is the “brown goo” result of being vomited out by an LLM (“brown writing” by Jason Fried)1 – Ruby’s commitment to whimsy feels almost revolutionary, punk, even.2
Look, in the internals of code, I prefer it to be functional, boring even. But when you name that beautiful mess of your creation, there’s a little sliver of daylight where the author can slip in humor, personality, beauty, and wit. Naming a blob of code can be a calling card, a thumb-print, and a punk-as-hell free-speech act.
Footnotes
- Fried noticed that since LLMs are probabalistic models, they take the most-average writing and mean-ify novel writing (i.e. what you wrote) to look minimally variant to their training data. It’s a world of personal statements written to be perfectly impersonal in all the same way.
- As Uberto Eco in The Name of the Rose and Mel Brooks when speaking of The Producers remind us: You weaken authoritarians when you teach those under their boot-heel to laugh, and all the more, laugh at the wearer of the boot