Skip to content
0:00 / 0:00

#elm#algebraicdatatypes#type-drivendesign

"Making Impossible States Impossible" by Richard Feldman

elm-conf

3.2K subscribers • 4 videos on Hallway

YouTube
  • Recommended by 9 people: 9 on Hacker News.
  • A classic. People kept recommending it from 2017 to 2024.
  • Presented by Richard Feldman, Elm developer

Intermediate. Assumes working knowledge.

63K views10 years ago9 recommendations

Software designProgramming languagesFunctional programmingDesign patternsSoftware architecture

Richard Feldman explains how to design data models using Elm's type system to prevent invalid application states at compile time.

Among the most time-consuming bugs to track down are the ones where we look at our application state and say "this shouldn’t be possible." We can use Elm’s compiler to rule out many of these bugs in the first place—but only if we design our Models using the right techniques! This talk explores how.

Why it's here

9 people recommend this

What people say. Highly recommended as a foundational talk on type-driven design and making invalid states unrepresentable.

joshuahornbyon Hacker News • Recommends

On “Ask HN: What’s your favorite talk from 2017?”

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

jasimon Hacker News • Recommends

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. link to this video

kilianon Hacker News • Recommends

On “Ask HN: What are some of the best technical talks you've heard?”

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

terminatorneton Hacker News • Recommends

On “Why I Use Elm in 2023”

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

terminatorneton Hacker News • Recommends

On “Make invalid states unrepresentable (2023)”

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

aczerepinskion Hacker News • Recommends

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. link to this video

jasimon Hacker News • Recommends

On “Writing ReasonML Bindings for JavaScript APIs”

…programming (pattern-matching over head, ...tail inside recursive functions). And if you create your types in a way that invalid states are impossible, you've just reduced the cognitive load needed to work on the system for the rest of its life by an order of magnitude. Here are some resources on this wonderful programming technique: - link - link to this video - link - link…

jasimon Hacker News • Recommends

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 link to this video

bretthopperon Hacker News • Recommends

On “Parse, Don’t Validate”

I just watched a good Elm conference talk about this same concept called "Making Impossible States Impossible" - link to this video

jasimon Hacker News • Recommends

On “Ask HN: How to improve code quality while maintaining decent velocity?”

* Learn to think about types first, and the algorithms as a natural consequence of the structure of your data. Richard Feldman: link to this video , * Use a statically typed language that allows fast refactoring. Ideally a typed functional language like Elm, Reason, OCaml, or Haskell. I recently shipped a complex Javascript project (without types) and it is one of the few instances of my decade-old professional career where I had that level of confidence in the robustness of a piece of code I wrote. It remained sturdy in production even in the presence of unforeseen conditions. This was thanks to the habits I picked up from typed FP: parsing and validating all data at the boundaries of the system, bett…

1-moreon Hacker News • Recommends

On “Applying “make invalid states unrepresentable””

A great talk on this subject is "Making Impossible States Impossible" by Richard Feldman from Elm Conf 2016 link to this video

jesperlangon Hacker News • Recommends

On “What can a pipe wrench teach us about software engineering?”

I've seen this way of state modelling pop up more and more recent year in me feeds. Make impossible states impossible. It's a great way to keep you sane! link to this video (Elm) link (Kotlin)

amituon Hacker News • Recommends

On “Ask HN: Programming talks that made something click for you?”

"Making Impossible States Impossible" by Richard Feldman (2016): link to this video "Understanding style" by Matthew Griffith (2017): link

terminatorneton Hacker News • Recommends

On “Strong typing, a hill I'm willing to die on”

It's a shame so many people have had bad experiences with static typing due to Typescript. In languages like Rust and Elm, static typing truly feels like a super power when I'm coding, particularly when modeling my applications possible states. This talk does a great job at articulating how to use types to disallow invalid/illegal states. link to this video

u/XzwordfeudzXin r/functionalprogramming • Mentions

On “On Not Drinking the FP Kool-Aid”

Also the ones by Richard Feldman are fantastic link to this video link to this video link to this video Very concrete and practical examples showing how we can build more robust software.

u/davimikuin r/typescript • Mentions

On “PSA: You can have arrays with a minimum length.”

This particular example is discussed in this article Type Safety Back and Forth which talks about getting the first element of the list, either you push the safety "backward" by making the return type indicate that there may not be a first element, or you push it "forwards" by only accepting an argument that has a first element. The larger "catchphrase" around this is Make Illegal States Unrepresentable - that article has some particular examples but the catch phrase has been around longer, primarily in the Haskell community. It's also related to the Parse, Don't Validate concept in the sense that illegal states can be stopped at the boundary of the program and not let "inside". However,…