Welcome to this course on debugging with Python!
Like many others, you’ve learned to code in Python to transform your ideas into programs (video games, websites, and mobile apps). You’ve discovered coding basics that apply to many programming languages: variables, conditions, loops, and functions. You’ve taken your first steps in object-oriented programming (OOP), and you might even have delved into the web with Flask and Django.
But, like a Pokémon trainer who sometimes stumbles across wild Pokémon, your brave quest through the programming world sometimes brings you into contact with bugs. The question is not whether you’ll meet one, but when.
This course will equip you with everything you need to make sure these encounters go as smoothly as possible. You can now stop worrying when you create a bug—don’t be too hard on yourself, and don’t think that it means that programming isn’t for you!
Debugging is a skill that everyone must learn—it’s not something you’re born with. However, bugs are part of life for developers. They can also help improve your skills. Most programmers could change their job title to “debugger!”
Make the Most of the Content
Before starting this course, a few words of advice on getting the most out of it:
Some chapters begin with a video providing a first insight into the chapter’s key concepts.
We’ll detail these concepts more in the text (with examples).
Screencasts accompany the text, where I’ll demonstrate how to carry out debugging tasks.
Finally, each part ends with a quiz, so you can test your new knowledge as you go through the chapters.
By the end of this course, you’ll come to love bugs! Not creating them, of course, but resolving them (and the feeling of achievement it brings). You’ll see bugs as friends and not the enemy. Finally, you’ll debug quicker, your code will be more robust, and you’ll enjoy programming more.
Practice Debugging
To help friend bugs, I’ll give you examples to practice debugging as we go along. You’ll even work on a project tracking down and fixing bugs, ending up with a working application.
For effective debugging, we’re going to use several tools:
You’ll learn to use the Python modules pdb and logging.
You’ll also see two of the most commonly used IDEs in Python programming—PyCharm and Visual Studio Code.
Finally, you’ll see how to debug with the Flask and Django frameworks.
To check you’ve understood everything, make sure you complete the exercises in the chapters and the quiz at the end of each part. You might be surprised at how much extra information you’ll find in the quiz to help you understand the different concepts.
Don’t just watch the screencasts with step-by-step demonstrations—practice along with me! Together with the quizzes and the exercises, this is one of the most effective ways to help you remember the new concepts.
Carry Out a Technology Watch
Debugging is an art. Like all art forms, it’s constantly changing and improving. New methods and tools are continually appearing. With this in mind, I’ll provide you with some extra resources to carry out a technology watch on the state of debugging. These resources will also help you continue to improve your skills. You’ll find everything you need to become a true software craftsperson!
Ready to begin the adventure? In the next chapter, you’ll discover three different types of bugs. Let’s get started!