Initialization

Initialization is something you do at the beginning of a program to ensure you start in a known state.

Every Day Life Example

Initialization happens at the beginning of every game. Everyone starts with a zero score. If you don’t initialize, then people would start with the last score they had and that wouldn't be fair.

image: http://www.billy-ball.com/2011/07/the-fun-of-game-scores/

Classroom Example

Let’s say you do the same thing as in the "sequence" example – stand up, clap 5 times, say “meow” and stamp your foot 2 times. Are you standing or sitting at the end of this? What happens if I ask you to do it again? You’re already standing, so you can’t stand up again. In order to make this work, you should initialize the script by making sure everyone is sitting down at the beginning. That way your script will work the way you expect it.