
Episode 30
030: Debugging in Elm
We talk about our favorite debugging techniques, and how to make the most of Elm's guarantees when debugging.
May 10, 202159m 1s
Audio is streamed directly from the publisher (cdn.simplecast.com) as published in their RSS feed. Play Podcasts does not host this file. Rights-holders can request removal through the copyright & takedown page.
Show Notes
- Rubber ducking
- Lay out your assumptions explicitly
- Veritasium video The Most Common Cognitive Bias
Elm Debugging techniques
Debug.todo- Frame then fill in
- Annotation let bindings
- Using nonsense names as a step
- Elm review rule to check for nonsense name
Hardcoded values vs debug.todo
- Todos don't allow you to get feedback by running your code
- TDD
- Fake it till you make it
- Simplest thing that could possibly work
- Joël Quenneville's article Classical Reasoning and Debugging
- Debugging is like pruning a tree
Breaks
- Take a walk. Step away from the keyboard when you're grinding on a problem
- sscce.org (Short, Self Contained, Correct (Compilable), Example)
- Create a smaller reproduction of the problem
- Reduce the variables, you reduce the noise and get more useful feedback
- Reasoning by analogy from Joël's post
- Elm debug log browser extension
node --inspectelm-test-rs
Debug.log in unit tests
Test.onlyfor running just onetestordescribe- Put
Debug.logs in each path of an if or case expression - Use the browser elm debugger to inspect the model
- Scaling Elm Application episode
- Narrow down your search space with Elm types
- Parse, Don't Validate episode
- Tiny steps help you prune the tree
- Exploratory Testing
- Wrap early, unwrap late