Debugging for Beginners / Chapter 1 — Reading Errors (lessons 1–5) / Lesson 1
What Debugging Is: Separating Symptom, Cause and Fix
Time needed: about 11 min (estimate)
Reading settings
These settings are remembered on this device only.
You can try the opening of this lesson without an account.
What is going on when code doesn't work
When a program doesn't do what you expected, three things are tangled in your head: the symptom (what happened), the cause (why it happened) and the fix (what to change). Debugging usually goes wrong because we jump from the symptom straight to a fix. In this course we use a script that totals orders for a small bakery called Komugi-do, and learn to get from symptom to cause by procedure.
Let's run one. Two anpan (360 yen), one loaf of bread (320 yen) and three croissants (720 yen) should total 1400 yen.
Tab indents. To leave the editor, press Esc, then Tab.
Create a free account to keep reading
With an account you can read the rest of this lesson, take the quiz, and read every free lesson in this course. Lessons you answer correctly are recorded as complete.
Report a problem with this lesson
Log in to send a report.