The Eric Normand Podcast

Why don't I encounter more type errors when programming in Clojure?

May 15, 2023
Explore the fascinating differences in error handling between Clojure and Haskell. Discover why dynamically typed languages like Clojure produce fewer type errors compared to statically typed ones. The discussion reveals how these distinctions can shape programming practices and influence a developer's approach to mistakes. Gain insights into the perception of errors and how it affects coding experiences.
Ask episode
AI Snips
Chapters
Transcript
Episode notes
INSIGHT

Typed vs Untyped Error Perception

  • Typed languages transform many programming mistakes into type errors, while dynamically typed languages like Clojure consider them different errors.
  • This changes how developers perceive and classify errors, explaining why Clojure programmers don't feel like they encounter many type errors.
ANECDOTE

Argument Order Mistakes Aren't Type Errors

  • Eric describes a common mistake of swapping argument order in a function: putting an integer where a string should be and vice versa.
  • In typed languages this triggers a type error, but in Clojure it's seen simply as an argument order mistake, not a type error.
INSIGHT

Typo vs Type Error Differences

  • Many errors in Clojure such as typos or wrong field names cause failures but aren't perceived as type errors.
  • In contrast, Haskell would catch these as type errors, showing fundamental difference in error classification.
Get the Snipd Podcast app to discover more snips from this episode
Get the app