HackerTube
HomeLongsLikedHistoryWatch laterCategoriesPlaylistsSettings

"Making Impossible States Impossible" by Richard Feldman

elm-conf9 HN recommenders · recommended in 13 months, 2017-2026
YouTube
63K views · 10 years ago · talk · evergreen

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.

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

Functional programmingSoftware architecture & design#elm#typesystems#makeillegalstatesunrepresentable#functionalprogramming#datamodeling

19 comments from Hacker News

@1-more2026 · in “Parse, Don't Validate (2019)”

A related talk is Richard Feldman's "Making Impossible States Impossible." Richard wrote a number of Elm packages and is the creator of the Roc language. ▶ this video

CitesView on HN
@terminatornet2024 · in “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.

Strongly recommendsView on HN
@terminatornet2023 · in “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. ▶ this video

RecommendsView on HN
@nateabele2023 · in “We use TypeScript not based on preference, but because we want to make money”

Sure, but the point is, a halfway decent type system will eliminate whole classes of errors—consequently eliminating whole swaths of things you would ever need to write tests for. What's more, though, is that a good type system will help you 'Make Impossible States Impossible'[0]—even more behavior you don't have to test because bad behavior is simply not representable in your program. Tests are strictly more powerful in the small, because they can be arbitrarily complex, but I would say a (really good) type system is more powerful in the large, because you get way more leverage in terms of overall program correctness. A lot of my personal projects are in Elm (yeah, yeah, bring on the hate)—the models are really well-defined, but the test suites usually only have a handful of tests of behavior I really want to verify. Haven't even played with the property checker yet, but again, that's something that is strictly more powerful than unit tests, but you can only get it* if you have a type system. [0] ▶ this video * Okay that's not really true: see clojure.spec in Clojure—but there are so few counterexamples that it's true for most practical purposes

CitesView on HN
@terminatornet2023 · in “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.

Strongly recommendsView on HN
@scns2023 · in “What Is Type-Level Programming?”

With strong type system a la ML (OCaml, Haskell, F#, Rust, Elm etc) it is allready possible, am i wrong? ▶ this video

CitesView on HN
@amitu2021 · in “Ask HN: Programming talks that made something click for you?”

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

RecommendsView on HN
@jesperlang2020 · in “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! ▶ this video (Elm) link (Kotlin)

RecommendsView on HN
@1-more2020 · in “Applying “make invalid states unrepresentable””

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

RecommendsView on HN
@jasim2019 · in “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: ▶ 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, better design by modelling data to make inconsistent states impossible, and automatically handling all edge-cases at all times. So even if you don't actively use such a language in your workplace, there really is a payoff to learning it in making you a better programmer overall.

RecommendsView on HN
@bretthopper2019 · in “Parse, Don’t Validate”

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

RecommendsView on HN
@jasim2018 · in “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

RecommendsView on HN
@kilian2018 · in “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.

Strongly recommendsView on HN
@jasim2018 · in “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

Strongly recommendsView on HN
@jasim2018 · in “Reason ML toolchain”

ReasonML is IMO quite ready for production work if you use it for building server-side applications with NodeJS or rich front-end applications with React (ReasonReact). The target audience for Reason (at least for the moment) are web application developers who want to level up as programmers and want to build elegant, sturdy production systems. Reason and Elm together are democratizing statically typed functional programming and I believe that the next 10 years are going to see a massive change in the programming language landscape, with the practice of typed FP finally finding adoption in mainstream commercial programming. The allure of Reason is in its packaging of OCaml to the web browser (which is made possible by BuckleScript - the actual OCaml to JS compiler doing the heavy lifting), its syntax that is familiar to the vast majority of programmers today, and the large ecosystem of bindings, libraries, and documentation that the team has put out. OCaml is a very pragmatic language; its main pull is its powerful static type system and immutable, functional programming, but the "O" in OCaml stands for "Objective" - it is an implementation of CAML with support for object-oriented programming. But you almost never need objects. OCaml's module system and its idioms allows you to write well-encapsulated code without mutation, and when you actually need to write honest to metal imperative code, you can do it with abandon because OCaml is not a "pure" functional language like Has

CitesView on HN
@joshuahornby2018 · in “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.

Strongly recommendsView on HN
@jasim2017 · in “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 type, but you don't need to convert it into a native record. JS arrays are also natively supported - it maps 1:1 to BuckleScript's array. I like to convert arrays into lists since they are better suited for value-based 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 - ▶ this video - link - link

RecommendsView on HN
@jon492017 · in “Diminishing returns of static typing”

Languages like F# give a nice sweet spot between static typing and dynamic typing. It has Type Providers that "generate" code on the fly as you are typing. You don't need to specify all the types, it will infer many types for you. So, you almost feel like you are writing in a dynamic language but you it tells you if you are writing something incorrectly. I would not consider a language to be modern unless it has Type Providers I consider this to be such an essential feature. I believe Idris and F# are the only languages that have it. People are trying to push TypeScript to add it - who knows if it will happen. Many are saying that if you have a dynamic language you just need to be disciplined and write many tests. With good static typed languages like F# you can't even write tests on certain business logic since the way you write your code you make "impossible states impossible", see ▶ this video

CitesView on HN
@aczerepinski2017 · in “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

RecommendsView on HN
Effective ML1:09:24

Effective ML

Jane Street
30K views • 10 years ago
Domain Modeling Made Functional - Scott Wlaschin - KanDDDinsky 201950:49

Domain Modeling Made Functional - Scott Wlaschin - KanDDDinsky 2019

KanDDDinsky
74K views • 6 years ago
"Code is the Easy Part" by Evan Czaplicki38:26

"Code is the Easy Part" by Evan Czaplicki

elm-conf
43K views • 10 years ago
"Type-Driven Program Synthesis" by Nadia Polikarpova39:40

"Type-Driven Program Synthesis" by Nadia Polikarpova

Strange Loop Conference
15K views • 8 years ago
Edward Kmett - Type Classes vs. the World1:42:53

Edward Kmett - Type Classes vs. the World

Boston Haskell
36K views • 11 years ago
Elm Europe 2017 - Richard Feldman - Scaling Elm Apps59:51

Elm Europe 2017 - Richard Feldman - Scaling Elm Apps

Elm Europe
41K views • 9 years ago
Maybe Not - Rich Hickey1:03:29

Maybe Not - Rich Hickey

ClojureTV
181K views • 7 years ago
Philip Wadler  - Propositions as Types (Lambda Days 2016)56:58

Philip Wadler - Propositions as Types (Lambda Days 2016)

Erlang Solutions
20K views • 10 years ago
Evan Czaplicki - Let's be mainstream! User focused design in Elm - Curry On58:23

Evan Czaplicki - Let's be mainstream! User focused design in Elm - Curry On

Curry On!
82K views • 11 years ago
"Propositions as Types" by Philip Wadler42:43

"Propositions as Types" by Philip Wadler

Strange Loop Conference
143K views • 11 years ago
"Make the Back-End Team Jealous: Elm in Production" by Richard Feldman31:14

"Make the Back-End Team Jealous: Elm in Production" by Richard Feldman

Strange Loop Conference
36K views • 11 years ago
Are We There Yet - Rich Hickey1:10:05

Are We There Yet - Rich Hickey

Zhang Jian
24K views • 7 years ago
"A Little Taste of Dependent Types" by David Christiansen38:36

"A Little Taste of Dependent Types" by David Christiansen

Strange Loop Conference
48K views • 8 years ago
Rich Hickey rants about HttpServletRequest in 1080p: Death By Specificity from Clojure Made Simple4:57

Rich Hickey rants about HttpServletRequest in 1080p: Death By Specificity from Clojure Made Simple

Fred Overflow
43K views • 6 years ago
Domain Modeling Made Functional - Scott Wlaschin51:40

Domain Modeling Made Functional - Scott Wlaschin

NDC Conferences
71K views • 9 years ago
Effective Programs - 10 Years of Clojure - Rich Hickey1:14:52

Effective Programs - 10 Years of Clojure - Rich Hickey

ClojureTV
176K views • 9 years ago
"Finding bugs without running or even looking at code" by Jay Parlar40:27

"Finding bugs without running or even looking at code" by Jay Parlar

Strange Loop Conference
42K views • 7 years ago
"Simple Made Easy" - Rich Hickey (2011)1:01:39

"Simple Made Easy" - Rich Hickey (2011)

Strange Loop Conference
219K views • 5 years ago
Brian Beckman: Don't fear the Monad1:07:10

Brian Beckman: Don't fear the Monad

jasonofthel33t
415K views • 13 years ago
The Maximal Graph - Wilker Silva39:15

The Maximal Graph - Wilker Silva

ClojureTV
8K views • 6 years ago