"Making Impossible States Impossible" by Richard Feldman

elm-conf · 63K views · 2016 · 25:06

Open on YouTube

Functional programmingSoftware architecture & designtalk

Why Hacker News recommends it

HN repeatedly recommends it as a talk that changed how people model data, with ideas that apply well beyond Elm to any typed language.

What it is

Richard Feldman's elm-conf talk on designing models so that bugs from impossible application states cannot occur, using Elm's compiler and types. It demonstrates techniques for making invalid states unrepresentable.

Recommended by 9 HN commenters across 13 different months, 2017 to 2026.

What Hacker News said

Strong rec joshuahornby · 2018-01 · on “Ask HN: What’s your favorite talk from 2017?”

"Making Impossible States Impossible" by Richard Feldman [this video] Really changed how I think about programming.

Strong rec jasim · 2018-09 · on “Try OCaml”

The type system is a lot more expressive than the ones found in Java/C#/C++, thanks to Algebraic Data Types. Yaron Minsky (Jane Street, largest OCaml user) coined the term "make invalid states unrepresentable" to explain how ADTs help in enlisting the help of the compiler to help us express our intent correctly, and Richard Feldman (NoRedInk, largest Elm user) has given an absolute gem of a talk that dives into that idea with relatable, concrete examples. It is titled "Making Impossible States Impossible" and should clarify this concept nicely. [this video]

Strong rec kilian · 2018-10 · on “Ask HN: What are some of the best technical talks you've heard?”

Making impossible states impossible" by Richard Feldman: [this video] has really changed the way I approach dealing with data in my code and was very insightful.

Strong rec terminatornet · 2023-05 · on “Why I Use Elm in 2023”

highly recommend the talks "making impossible states impossible" and "make data structures" by richard feldman. [this video] [LINK] the talks are geared towards elm but I think they offer some great advice applicable to programming in general.

Strong rec terminatornet · 2024-04 · on “Make invalid states unrepresentable (2023)”

one of my favorite talks on this topic, "Making Impossible States Impossible" by Richard Feldman: [this video] the talk is Elm lang focused, but the concepts still apply to other languages.

Recommends aczerepinski · 2017-09 · on “To type or not to type: quantifying detectable bugs in JavaScript”

There's a great talk on this subject by Richard Feldman from Elm Conf. I haven't used typescript so I'm not sure if the techniques translate well. [this video]

Recommends jasim · 2017-12 · on “Writing ReasonML Bindings for JavaScript APIs”

There is no escaping the mapping. It doesn't matter if it is Reason or PureScript, Elm, or Fable - you have to parse the incoming data into a static type if you want to enjoy the benefits of types. The good thing is that you can build the rest of your system with a firm guarantee on the shape and structure of the data. No null checks, no missing keys. If you are careful with your parsing you can raise exceptions or return None if the incoming data is not well-formed (missing keys or even extra keys). Reason/BuckleScript when run on a Javascript runtime also has a `Js.t` type which is basically the Javascript object. You do have to define the shape of it similar to how you'd define a record t

Recommends jasim · 2018-11 · on “Book Review: A Philosophy of Software Design”

That'll be a great addition to the book. Can I also recommend Yaron Minsky's talk on OCaml, specifically the part where he talks about "making invalid states impossible": [LINK] I've found this to be the single most valuable programming technique I've learnt. Richard Feldman dives deeper into the topic with a lot more examples in [this video]