The Eric Normand Podcast

Where does the power of Nil Punning come from?

Sep 30, 2019
Dive into the intriguing world of nil punning in programming languages! Discover how nil can convey different meanings, especially in Clojure and Lisp. The discussion turns critical as it reveals the pitfalls of nil punning in JavaScript, advocating for more meaningful alternatives. Listeners are encouraged to reflect on their own experiences, making it a thought-provoking exploration of absent values in functional programming!
Ask episode
AI Snips
Chapters
Transcript
Episode notes
INSIGHT

Power of Nil Punning

  • Nil punning's power lies not in nil's multiple meanings, but in the language design choices for each context.
  • Each decision about nil's behavior in a new context can either streamline the language or introduce inconsistencies.
ANECDOTE

Keyword and Nil

  • Calling keyword with nil in Clojure returns nil, illustrating a potentially problematic design decision.
  • This behavior, where nil flows through functions without errors, can make debugging difficult.
ADVICE

Handling Nil

  • If nil doesn't have a clear meaning in your context, throw an exception instead of assigning it an arbitrary meaning.
  • Avoid clever uses of nil; make it clear when it lacks sufficient meaning.
Get the Snipd Podcast app to discover more snips from this episode
Get the app