Summary of the Basic Building Blocks of a Computer Program

Review what we have covered in this chapter.

We'll cover the following

Chapter summary

In this chapter, we discussed the most fundamental concept that we have in programming: sequences.

Sequential thinking can help us structure our ideas so that we can break them down into smaller pieces. As we have mentioned in this chapter, grasping everything a program needs to do can be hard, so we need a way to be able to focus on the details without losing the overview of what the program needs to do.

The concept of doing things in sequence is also at the very heart of any program, because the instructions we write are executed one after the other. This is important because we need to make sure that these instructions come in the right order.

The instructions we write are made up of statements, and we learned that some statements are short and simple, while others can span several lines and be made up of other statements. Some are smaller building blocks, called expressions. We’re now on the abstraction level, where we can deal with the details, such as adding two numbers together.

Breaking down the code into smaller and smaller chunks allows us to think about how to structure our solution. Sometimes, we’ll need to document our line of thought to help us or other readers of our code see what made us choose this solution. We learned that comments can be used for this. Comments can also be used as a documentation of the code so that it’s clear what it does and how it can be used. Additionally, we saw that comments can be directed to the language compiler or interpreter to give instructions to it.

Get hands-on with 1200+ tech skills courses.