...

/

The Importance of Sequences

The Importance of Sequences

Learn about the importance of sequences with a problem scenario.

Performing sequences

Imagine that one day, you start craving a pie, so you decide to make one. The reason for baking a pie is not that you want to cook, but that you want to satisfy your craving for pie. But to be able to get the pie, you need to perform several steps. First, you need a recipe, and then you need to get all of the ingredients. Once you have all the ingredients, you’ll follow each step in the recipe. Then, finally, after the pie has baked in the oven and cooled down a bit, you can enjoy your well-deserved treat.

You just performed a few tasks in sequence. Some of them need to be completed in the right order, while others can be done in any order (or, at least, in a more relaxed order). You must turn on the oven before you can bake the pie, but it is not essential that you bring out the flour before the butter.

Programming is a lot like baking a pie. We’ll have goals (wanting pie) and to be able to achieve that goal, we will need to do several things; in some instances the order is essential, while others are less dependent on the order. Programming is all about problem-solving and the art of breaking things down into smaller steps. This will be done in iterations where ...