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

Debugging with Pry

Conrad Irwin
July 25, 2013
100

Debugging with Pry

Slides from Debugging with Pry at Lumos Labs.

Conrad Irwin

July 25, 2013
Tweet

Transcript

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  8. Questions?
    @ConradIrwin

    View full-size slide