OO Programming  «Prev  Next»
Lesson 2 Traditional approach/ Procedural Programming
Objective Procedural programming and how it is used.

Traditional Approach of Procedural Programming

Prior to the rise of object-oriented programming, the most popular approach was procedural, or structured, programming. Structured programming uses top-down design to decompose a problem into a series of successively more granular functions.
Structured programming requires well-defined flow control. Languages that support this are often called procedural languages because of their heavy reliance on procedures.
Development begins by identifying the problem domaindefining what th, e problem is that your project is supposed to help solve. This is the case whether you use a procedural or an object-oriented design. Once the problem domain has been identified, however, the two methods diverge. Procedural designs begin by defining the procedures, starting with a top-level function. From there, the problem is broken into more specific procedures.

For example, a program that converts GIF files to JPEG files might begin with a single function called convertImage().
This function is then broken down into three functions called


In turn, each of these functions can be broken down even further.

Procedural Programming

Procedural programming refers to a programming paradigm derived from structured programming which is based upon the concept of the procedure call.
Procedures, also known as
  1. subroutines,
  2. methods, or
  3. functions
simply contain a series of computational steps to be carried out. Any given procedure might be called at any point during a program's execution, including by other procedures or itself. A list of instructions telling a computer what to do, usually having a linear order of execution from the first statement to the second occasional loops and branches. Procedural programming languages include C, C++, Fortran, Pascal, and BASIC.