Basic Concepts of Programming

You could get by in programming only knowing three concepts: Sequence, Selection, Iteration.

You could get buy, but it would be tough. These are the basics of basic - the foundations that you use in every program you'll ever write.


Things happen in order.

  1. Put your socks on

  2. put your shoes on

If you flip the order you have:

  • dirty socks

  • stinky shoes

Likewise commands follow an order - usually top to bottom, line by line.


Making decisions. Computers make decisions based on conditions. If the condition changes, so does the decision.

Think of a thermostat - if the room gets cold, the heat goes on. If the room warms up, the heat goes off.

Code decisions follow the if THIS then DO THAT format.

if isRaining: open(umbrella)


Loops. Computers are great because they can do the same thing over and over again and never get tired, never complain, never need to be fed or sleep. Computers can count forever without losing their place and they can repeat and repeat and repeat ... the sun rises, the sun sets. Lather, Rinse, Repeat.




If you understand these concepts it's just a matter of putting them into words.

Code is putting thoughts into words.

Only you have a very limited set of words you're allowed to use.

Next Post: Why are there different languages?

Recent Posts