Summary
In this short chapter, we looked at different techniques and suggestions for debugging, troubleshooting, and profiling our code. Debugging is an activity that is always part of a software developer’s work, so it is important to be good at it.
If approached with the correct attitude, it can be fun and rewarding.
We explored techniques to inspect our code using custom functions, logging, debuggers, traceback information, profiling, and assertions. We saw simple examples of most of them. We also discussed some guidelines that will help when it comes to facing the fire.
Remember always to stay calm and focused, and debugging will be much easier. This, too, is a skill that needs to be learned and it is the most important. An agitated and stressed mind cannot work properly, logically, and creatively. Therefore, if you do not strengthen it, it will be difficult for you to put all your knowledge to good use. So, when facing a difficult bug, if you have the opportunity...