Algorithms, loops and abstraction

An algorithm is a clear set of steps in order; abstraction hides the detail you do not need right now.

A worked example

Drawing a square is "repeat 4 times: move forward 100, turn right 90". The loop replaces four copies of the same two instructions.

The mistake people actually make

When a program does the wrong thing, trace the steps in order to find the faulty one rather than rewriting the whole thing. Breaking a problem into parts does not remove it, it makes each part testable.

Practice this free