Discover the basic ideas behind computer programs. Show
Before we can go too deep into physical computing and creating your own projects, it’s a good idea to have a good grasp of the ideas behind computer programming. This isn’t a full course on programming, there are lots of other courses you can do online and even on FutureLearn. xxx suggest course here? This gives you a basic understanding of the concepts behind programming. It will help you later on in the course when you’re creating. All programming languages have the same concepts. Regardless of how they’re written, where they run and what they do, they all make use of these basic concepts SequenceSequence is the order that commands go in. The order can really matter. Think of the instructions needed to make a cup of tea:
If you did number 3 before 2 then that wouldn’t matter. However, if you did 2 after 1 then you won’t have enough water for your cup of tea. This is a very simple example of sequence. We’ll highlight code examples in the actual programs later. SelectionSelect can be described as making a choice based on a criteria. Think of it as IF this THEN that. It can add new options to your scenario: IF you take milk with your tea THEN add milk to your tea Or it can create more efficient scenarios: IF the kettle has no water THEN fill the kettle with water Rather than always filling the kettle with water, you’re asking a question first then making a decision based on the answer. Selection is an important part of coding. It helps us choose different paths and react to situations. IterationIteration is repeating situations. There are many different types of iteration. You can repeat a task a set number of times: Stir the tea 3 times You can repeat a task until something happens: Stir the tea until the milk has mixed into the tea We will highlight these different types of repetition in the upcoming projects. Let’s look at our cup of tea task with Sequence, Selection and Iteration applied. We have the same number of steps but our process has become more precise (how long to stir for), efficient (we don’t fill the kettle if it has water in it already) and we have choice (milk or no milk)
Where else in your daily life can you see sequence, selection and iteration? These are not just programming concepts, these apply everywhere. Discuss in the comments a task you’ve noticed has one or all of these concepts. Any new ones you’ve just discovered?
When you write lines of code, there are three ways you can control the order these lines will be executed by the computer:
Take the quiz (open full screen): |