How I Built a Program to Find the Funniest Names (And What I Learned)

How I Built a Program to Find the Funniest Names (And What I Learned)

Jul 31, 2026 python nlp programming humor developer projects word games

markdown formatted blog content

Let's be honest: we've all encountered a name that made us snort-laugh in the middle of a serious meeting. Maybe it was "Hugh Jass" on a conference badge, or "Ben Dover" accidentally appearing in a company directory. These names walk a fine line between professional and ridiculous, and they've been making humans giggle for generations.

But what if we could find them at scale? What if we could write a program to identify the objectively funniest names ever recorded? That's exactly what I tried to do—and let me tell you, it was way harder than expected.

The Initial Approach: Word Matching 101

My first instinct was straightforward: find names that are also real English words. "Preserved Fish" immediately comes to mind (yes, that was an actual historical figure). "Clementine" works too. "Boulder" can be a last name. Simple, right?

I grabbed the names-dataset package—containing nearly 500 million names scraped from public sources—and paired it with WordNet as our dictionary. The logic seemed elegant: check if both the first and last name exist as valid English words, then flag it as potentially funny.

But here's where things got tricky. Most dictionaries don't include word variants. "Jerk" might be there, but "jerked" probably isn't. My solution was to use WordNet's synsets functionality, which accepts all grammatical variants of a word in one fell swoop.

Another complication: common names like "Simon" and "Peter" exist in dictionaries as proper nouns. To avoid false positives, I filtered out "instances"—words where every definition refers to a specific entity (like "Simon the Apostle"). Using any(not syn.instance_hypernyms() for syn in wn.synsets(word)), I could accept words with non-instance meanings while excluding pure proper nouns.

I even memoized the lookup function with @lru_cache, giving us O(1) average complexity instead of repeated dictionary traversals. Performance matters when you're processing millions of names.

The result? A measly 188 names. Disappointing, but not surprising. Most hilarious names don't work when you require both parts to be standalone words.

The Breakthrough: Name Partitioning

Time for Plan B. What if we could break names into smaller pieces and check those for validity?

Take "Hugh Jass"—it doesn't match as two full words, but "Hugh" + "Jass" can partition into "Huge" + "Ass" with just single-character edits. That's comedy gold.

The problem? Bell numbers. Those pesky Bell numbers.

Bell numbers calculate how many ways you can partition a set. They grow superexponentially. A 15-character name (the average length in my dataset) has over 1.3 billion possible partitions. We literally cannot check them all.

So I introduced a cap: MAX_PARTITIONS. Names that break into too many pieces are mostly single letters, which isn't funny anyway. "T. E. Lawrence" isn't hilarious—just tedious.

With partitioning enabled, I jumped from 188 names to nearly 5,000 candidates. Progress!

What Actually Makes a Name Funny?

Here's where the art meets the science. "Toyo Nashwan" technically breaks into valid words, but it's not remotely amusing. Finding genuinely funny names requires either manual curation or more sophisticated humor detection—which, honestly, might be an AI problem for another decade.

What I did discover is that the funniest names often involve:

  • Phonetic wordplay: Names that sound like crude phrases when pronounced
  • Unexpected combinations: Real words that shouldn't go together ("Summer Winter," "Crystal Clear")
  • Cultural dissonance: Names that clash with stereotypical expectations

The Developer's Takeaway

Beyond the laughs, this project illustrates something important about real-world programming: constraints define solutions. I couldn't process 1.3 billion partitions, so I had to think creatively about limiting the search space. I couldn't reliably detect pronunciation (without complex NLP), so I pivoted to word-matching. I couldn't measure "funniness" algorithmically, so I focused on generating candidates for human review.

Sound familiar? Every startup faces these tradeoffs. Every developer makes these judgment calls. The code that works isn't always the most elegant—it's the most practical.

If you want to explore the dataset or notebook yourself, everything is open-source with an MIT license. The code is available on GitHub, and the Jupyter notebooks let you follow the full journey from raw data to final results.


At the end of the day, the search for the funniest name is ultimately human. But with the right programmatic scaffolding, we can at least narrow the haystack before looking for that needle.

Now, if you'll excuse me, I need to go explain to my coworkers why I've been giggling at a spreadsheet for three hours.

What's the funniest name you've ever encountered? Drop it in the comments—we're building a collection.

Read in other languages: