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.
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.
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.
To add a description, open the Breakpoints Dialog.
First open the Edit Breakpoint dialog using any of the following:
ALT + ENTERon any line with a breakpoint and then choosing "Edit Breakpoint"
SHIFT+COMMAND+F8on any line with a breakpoint
- right-clicking on a breakpoint in the gutter
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:
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!
Originally published at https://zarah.dev on January 15, 2020.