2 Understanding your app’s logic through debugging techniques

This chapter covers

  • When to use a debugger and when to avoid it
  • Using a debugger to investigate code

Not long ago, during one of my piano lessons, I shared the sheet music of a song I wanted to learn with my piano teacher. I was so impressed when he just played the song while reading the music sheet for the first time. “How cool is that?” I thought. “How does someone gain this skill?”

Then, I remembered some years ago I was in a peer-programming session with one of the newly hired juniors in the company I was working for. It was my turn at the keyboard, and we were investigating a relatively large and complex piece of code using a debugger. I started navigating through the code, ...

Get Troubleshooting Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.