Module 7: Introduction to Programming Logic
Great! Now let's dive into the fascinating world of programming logic. This module is one of the most important in the prework, as well as one of the most challenging. Push yourself to put in the time and effort necessary to complete it fully.
Module 7 Deliverable
For this module, you'll be creating a game on the website Scratch. You will submit a text file with a link to your game. You can add this file to the prework folder on your computer and place it in the Module-7 subfolder.
The Challenge of Programming
One of the challenges of programming is the fact that computers are very, very dumb. Much of the complex logic and layered thinking that we humans take for granted is completely bewildering to even the most complex of computers.
Along the same lines, the art of coding and programming is principally focused on taking complex ideas and breaking them down into simple instructions that a computer, machine, or browser can interpret. Therefore, coding requires proficiency in two components that are needed to translate ideas into machine-language: computer syntax and computerthink.
Computer Syntax
Every coder must learn the syntax that a computer understands. Syntax is sort of like the grammar and punctuation of machine-speak. It's like knowing that every sentence has a subject and a predicate, or that every sentence should begin with a capital letter and ends with a punctuation mark. Programming languages come with their own rule sets. A rule set might specify a special meaning for brackets or symbols, for example, or specify a particular method for utilizing code across different files.
Throughout the course you'll be learning a ton of syntax. It may seem tricky at first, but it will become second nature in no time.
Computerthink
Coding means converting your ideas into computerthink. Unlike humans, computers are limited in their ability to work with anything abstract, vague, or general. For computers, complex problems need to be broken down into small, discrete blocks of logic.
Think Like a Computer
Take for instance the following challenge: How do you make a peanut butter and jelly sandwich?
You might make a list that looks like the following:
- Get two slices of bread, peanut butter, and jelly.
- Get utensils and a plate.
- Slather peanut butter and jelly on each slice of bread.
- Put the two slices of bread together.
Simple, right? Well, there's a little more to it when it comes to computerthink. Take item 3, for instance: Slather peanut butter and jelly on each slice of bread. While a human will probably understand this instruction, a computer would need to be given some additional information, including:
- How many times do you slather?
- In what What direction do you slather?
- What amount do you slather?
- What utensil do you use to slather?
- Which slice of bread do you slather first?
As you will find out, learning to code often requires one to think far more slowly than we are generally accustomed. Instead of rushing, your computer will force you to slow down and reason out your thoughts in a series of detailed steps.
What About the Future?
Until there's a major breakthrough in artificial intelligence, computers are here to stay. This is good news for us as developers, because it guarantees that our skills will be in demand for a long time to come.
The video below (which you should definitely watch!) will expose you to the logical building blocks used in almost every programming language. You will then use this newfound understanding to create a simple game using the visual programming language Scratch. Don't let the cartoony interface and silly cat logo deceive you. You can build some powerful things with Scratch, and this activity will be challenging. If you get stuck, use the resources linked below!