Lesson 3 · Computational Thinking
Repairing and making it better.
You've located the bug. Now comes the part people rush — and rushing here creates new bugs.
A proper fix has three parts:
That third point is the one beginners skip. Fixing one thing and quietly breaking two others is the most common way programs fall apart.
Suppose your game shows a score of -1. You could add a rule: "if the score is -1, show 0."
The symptom disappears. The bug is still there — and tomorrow it'll show -2.
A symptom fix patches what you see. A cause fix asks why the score went negative at all, and repairs that. Symptom fixes pile up until nobody can understand the program any more. Ask "why" until you reach something that actually explains the behaviour.
5 more parts in this lesson
Walkthroughs, code labs, mini-games and the checkpoint quiz unlock when you buy the course.