Debugging pt. 1

[vocab] debug | error message

M. Lim
Intro to Programming
2 min readJan 22, 2018

--

→ Lab Assignment: “Debugging Madlib” on repl.it

The first computer “bug” was literally a moth that was found inside Harvard University’s Mark II computer in 1945, by computer science pioneer Grace Hopper. Here is the actual moth, taped into her notebook.

Errors are valuable

“Imperfect is more interesting than perfect…”

…because we get to learn from mistakes.

Debugging is the process of identifying and removing errors from a piece of code. It helps to use the scientific method, to test ideas one at a time.

Error messages are printed by the shell whenever a program encounters an error while running. It’s important to read these because they give us clues about what we might need to fix. Error messages usually include a line number and the type of error found (ie. SyntaxError).

# Another common type of error:NameError: name '...' is not defined# This happens when you use an unknown variable or function name, something that has never been defined
This is Waldo.
Where’s Waldo?

Looking at a bunch of code can feel just like this at times. In the beginning, it takes a lot of time and patience just to figure out what’s happening in the code. But it gets easier with practice. The more you debug, the better you will get.

Click image to expand it

--

--