PLAY PODCASTS
030: Debugging in Elm
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.

Elm Radio

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

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