Ruby bindings

In Ruby, the pry gem lets you call binding.pry in your code. When it runs, you get dropped into a breakpoint. From there, you can play around with variables and methods, just like you would in a REPL.

Today I learned what binding actually is – it’s an object containing the current execution context at the point it’s called. Effectively, it’s a snapshot of the state of the Ruby VM at the time the breakpoint is hit.

And now, courtesy of @harxy:

Why was the meek programmer bad at debugging? Because he didn’t like to pry!


Currently CTO at Mast. Formerly engineering at Thought Machine, Pivotal. Makers Academy alumnus.

I've pledged to give 10% of my income to highly effective charities working to improve animal welfare. If my startup is successful, I hope to give away much more.

Also founded EA Work Club, a job board for effective altruists, and Let's Fund, a crowdfunding site for high-risk, high-reward social impact projects.

Subscribe here to get updated when I post.