Tune in to the tools and techniques in the Elm ecosystem.
030: Debugging in Elm
May 10, 2021
0:59:01
56.69 MB
Downloads: 0
- 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 --inspect
elm-test-rs
Debug.log
in unit tests
Test.only
for running just onetest
ordescribe
- Put
Debug.log
s 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