Debugging

Solving problems is in our human nature, debugging is the the process of identifying and removing errors from computer hardware or software.

There are lots of ways to find bugs, one may puts its way out of the problem. I've used lots of ways, one of the most effective ways I've found is to use a debugging tool.

Since I mostly code in Ruby I'll list some shortcuts that I've used with Pry debugger

 # Show all of the available methods that can be called by an object
  ls 

  # Step into an object, change the value of self
  cd

  # Take out of a level
  cd ..

  # Print the stack trace
  _ex_.backtrace || wtf?

  # Print context where debugger stopped
  whereami || @

  # Print context where stopped and last 10 lines
  whereami 10