Flowcharts and pseudocode: planning before you code

Computer Science · Key Stage 3 · The School

Flowcharts: shapes with fixed meanings

A flowchart uses shapes to show the steps of an algorithm. An OVAL starts or ends it. A RECTANGLE is an action. A DIAMOND is a decision, with one arrow out for yes and one for no. Arrows show the order. You can trace a flowchart with your finger and know exactly what the program will do, before a single line of code exists.

Pseudocode: code without a language

PSEUDOCODE writes an algorithm in plain steps, close to real code but without needing exact syntax. "IF age is 18 or more THEN allow entry ELSE refuse entry" is pseudocode. It can become Python, JavaScript or any other language later. The logic is decided first. The exact spelling comes after.

Why plan before you type

A mistake in a plan is one sentence to fix. The same mistake buried in fifty lines of working code can mean untangling logic spread across many places. Planning moves a fix to the cheapest possible moment: before it has been built into anything else.

Plan a program that checks a password. Pseudocode: GET the password. IF length is less than 8 THEN print "too short". ELSE IF it has no number THEN print "add a number". ELSE print "password accepted". Trace it with "cat" — too short, correct. Trace it with "password1" — long enough, has a number, so "accepted" — but is that really a strong check? Spotting that gap now, on paper, costs one sentence. Finding it after the code is written and already trusted by other code costs far more.

The School — all subjects · Knowledge map