Which is Which: Named Breakpoints

Image for post
Image for post
Photo by Robert Anasch on Unsplash

I have always believed that one of the biggest factors that influence a person’s enjoyment and delight in doing their job are the tools. Having the right tools and using them the best way possible helps direct our energy on the what rather than the how.

It is for this reason that I have written and spoken about making the most out of Android Studio a few times over the past few years.

For instance, I have lost count of how many times I stopped in the middle of a debugging session only to find myself drowning in breakpoints. I have put in so many that I have lost track of which breakpoint does what, or why I even put a breakpoint on a particular line in the first place.

Image for post
Image for post
What are even these lines

It is situations like this that breakpoint descriptions become super handy. These descriptions appear after the line number and provide an easy way of keeping track AND searching for breakpoints.

For example, adding “drag dismiss” after the breakpoint on line 84 serves as a short note to myself what that piece of code is doing. It gives me a hint about what I may want to do with that breakpoint when I’m grouping, muting, cleaning up, or managing all the other breakpoints.

Image for post
Image for post
Breakpoint with a description

To add a description, open the Breakpoints Dialog.

First open the Edit Breakpoint dialog using any of the following:

Image for post
Image for post
Edit Breakpoint dialog

We can then click on More or press SHIFT+COMMAND+F8 to open the Breakpoints Dialog. Right click on the breakpoint in question and choose Edit Description:

Image for post
Image for post
Adding a description

This is admittedly an over-simplified example (in my main project I have so many breakpoints accumulated over so many debugging sessions and I’m afraid to remove any of them. Don’t @ me.), but finding a specific breakpoint is now easy as!

Image for post
Image for post
Search through all breakpoints easily

Originally published at https://zarah.dev on January 15, 2020.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store