Basic Concepts of Programming
- Michael Tomaino
- Nov 7, 2016
- 1 min read
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.
Sequence
Things happen in order.
Put your socks on
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.
Selection
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)
Iteration
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.
Sequence
Selection
Iteration
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.





Comments