3.5 — More debugging tactics

In the previous lesson (), we started exploring how to manually debug problems. In that lesson, we offered some criticisms of using statements to print debug text: Debug statements clutter your code. Debug statements clutter the output of your program. Debug statements require modification of your code to both add …

3.4 — Basic debugging tactics

In the previous lesson, we explored a strategy for finding issues by running our programs and using guesswork to home in on where the problem is. In this lesson, we’ll explore some basic tactics for actually making those guesses and collecting information to help find issues. Let’s start with an …

3.2 — The debugging process

Let’s say you’ve written a program, and it’s not working correctly — the code compiles fine, but when you run it, you’re getting an incorrect result. You must have a semantic error somewhere. How can you find it? If you’ve been following best practices by writing a little bit of …