Procedural Abstraction

Excerpt from Chapter 21 of the App Inventor book, authored by Ellen Spertus:

The ability to name and later call a set of instructions like MoveMole is one of the key tools in computer science and is referred to as procedural abstraction. It is called abstraction because the caller of the procedure (who, in real-world projects, is likely to be different from the author of the procedure) only needs to know what the procedure does(moves the mole), not how it does it (by making two calls to the random-number generator). Without procedural abstraction, big computer programs would not be possible, because they contain too much code for one person to hold in his head at a time. This is analogous to the division of labor in the real world, where, for example, different engineers design different parts of a car, none of them understanding all of the details, and the driver only has to understand the interface (e.g., pressing the brake pedal to stop the car), not the implementation.

Some advantages of procedural abstraction over copying and pasting code are:

In later chapters, you will learn ways of making procedures even more powerful: adding arguments, providing return values, and having procedures call themselves. For an overview, see Chapter 21.