Procedural Abstraction

Definition of ‘Abstraction’ : the quality of dealing with ideas rather than events.

You can read about Abstraction and data abstraction in my previous blog post.

In this blog post we’ll learn about Procedural Abstraction, Procedural Abstraction is something like dividing the complex problem into subproblems and implementing it through sub procedures.

Procedural abstraction is not simply that one is dividing the program into parts.After all , we could take any large program and divide the program into parts – the first ten lines,next ten lines and so on.It is crucial that each procedure accomplishes an identifiable task(i.e represents an idea) that can be used as a module in defining other procedure.For example we are defining a procedure named good-enough?  ,

(define (good-enough? guess x)
  (< (abs (- (square guess) x)) 0.001))

In above example we are using sqaure as black box i.e it is doing something but we are not concerned with how it is doing. The details of how square is computed can be suppressed, to be considered at a later time.Indeed, as far as the good-enough? procedure is concerned, square is not quite a procedure but rather an abstraction of a procedure, a so-called procedural abstraction. So the person which is implementing good-enough? doesn’t care about how square is working he can fully concentrate upon good-enough? which will create abstraction.

One of the biggest advantages of procedural abstraction is many users can work upon different modules due to which efficiency of team could be increased.We can hide details and gives us the building block that can be reused in other situation.We can easily replace implemetation by better ones.

To summarise, procedural abstraction is a way to implement abstraction and each sub-procedure should represent an idea.