ICSCT - Abstractions in Algorithms Lesson

Abstractions in Algorithms Lesson

Abstraction is the process of reducing the complexity of a system by hiding the irrelevant parts so you can focus on the important details. An automobile is a perfect example of abstraction. It is a very complex system. However, you do not need to know everything there is to know about a car to drive a car.    

In computer science, we rely on abstraction to make things easier. One example of abstraction is procedural abstraction. Once an algorithm is written down and tested it can become a method. You developed a method to create any polygon in an earlier lesson. This method can be used in other programs without writing every step again. The other type of abstraction is data abstraction. The details of the data can be hidden so you can focus on the important parts. You do not need to know the details of the method.  That information is hidden. You just need to place the methods in the correct order to produce the right output.      

Programming languages are built with layers of abstraction. Each program comes with pre-defined methods that you can use to create your program. 

Scratch uses blocks that lock together. We do not know the code for the move method. Those instructions are hidden. We just need to know how to use those instructions in our code to produce the desired action.  

The more abstractions in a computer program, the easier it is to use. However, functionality is lost within the layers of abstraction. You may not be able to get the level of detail you would like because the move method is programmed to behave a certain way and it cannot be changed.    Levels of abstraction in programming  using scratch and high level programming language

[CC BY 4.0] UNLESS OTHERWISE NOTED | IMAGES: LICENSED AND USED ACCORDING TO TERMS OF SUBSCRIPTION