Elm Radio

030: Debugging in Elm


Listen Later

  • 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 one test or describe
  • 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
...more
View all episodesView all episodes
Download on the App Store

Elm RadioBy Dillon Kearns, Jeroen Engels

  • 5
  • 5
  • 5
  • 5
  • 5

5

16 ratings