Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Debugging with Pry

Conrad Irwin
July 25, 2013
97

Debugging with Pry

Slides from Debugging with Pry at Lumos Labs.

Conrad Irwin

July 25, 2013
Tweet

Transcript

  1. View Slide

  2. From http://www.codeodor.com/images/frustrated.jpg

    View Slide

  3. “Beware of bugs in the above code; I have
    only proved it correct, not tried it.”
    — Donald Knuth

    View Slide

  4. From http://thecollaboratory.wikidot.com/2013-philosophy-of-thought-logic

    View Slide

  5. View Slide

  6. View Slide

  7. View Slide

  8. Use binding.pry
    Easier to write.
    Easier to read.
    Can explore interactively.
    Can fix things interactively.

    View Slide

  9. Use binding.pry
    whereami
    $ (aka. show-source)
    ls
    edit

    View Slide

  10. Use binding.pry
    cd
    ? (aka. show-doc)
    up (and down)
    try-again (with rescue rails server)
    help

    View Slide

  11. Debugging is fun
    49.9% of your time is spent debugging.
    Optimize that.
    Pry can help.

    View Slide

  12. Questions?
    @ConradIrwin

    View Slide