TECHNOLOGY · 5 MIN
Think like a programmer
Break a big problem into small, testable steps.
If a program works on one example, is it correct?
Computers do what you say, not what you mean.
An algorithm is a recipe
An algorithm is a precise list of steps, like a recipe. Here is one that averages numbers. Computers follow each step exactly. They can’t guess what you meant.
Test the edges
Test an ordinary input first. Four, six, and eight average to six. Now try an empty list. The count is zero, and dividing by zero breaks the program. Always test the edges.
Turn on JavaScript to watch each board draw itself, solve one on your own and explain it back.
More in Technology
See the whole library