Procedural Programming: Pros and Cons of This Language

Harsh Gupta - Tech Writer
The procedural programming methodology involves dividing a large program into a set of sub-procedures or subprograms that perform specific tasks. In this methodology, a program is divided into one or more units or modules. These modules can be user-defined or can be taken from libraries.

A module can consist of single or multiple procedures. These procedures are also known as functions, routines, subroutines, or methods in various programming languages.

A procedural program can consist of multiple levels or scopes. A procedure can be defined independently or within another procedure. The level of the procedure depends on the definition. Similarly, the data available in the procedure also exhibits various levels or scopes. The procedure of a higher or outer scope cannot access the data within the procedure that has lower or inner scope.

A procedure or a subprogram is a set of commands that can be executed independently. In a program following procedural methodology, each step of a subprogram is linked to the previous step.

For example, in a program that needs to accept, display, and print data, you can divide the program into subprograms. You can create three subprograms that accept data, display data, and print data, respectively. Each subprogram performs a defined function while the combined action of subprograms makes a complete program.

In procedural programming, you can use a subprogram at multiple locations within a program to perform a specific task.

This enables you to reuse the program code as and when required in a program, without rewriting the entire code, as shown in the figure:

The figure displays a program that consists of three procedures. Accept Data, Display Data, and Print Data. Data is accepted in the Accept Data procedure, displayed in the Display Data procedure, and printed in the Print Data procedure.

Procedural programming is used for developing simple applications. The languages that use the procedural programming methodology include Pascal and C languages.

Some of the benefits of the procedural programming methodology are:

Easy to read program code.

Easy maintainable program code as various procedures can be debugged in isolation.

Code is more flexible as you can change a specific procedure that gets implemented across the program.

The features of procedural programming methodology are:

Large programs are divided into smaller programs.

Most of the data is shared as global that can be accessed from anywhere within the program.

In the procedural programming approach, portions of the code are so interdependent that the code in one application cannot be reused in another. For example, the module used to calculate the salary of the employees in a bank management system cannot be used to calculate the salary of the employees in an educational institute. You need to create a separate module to calculate the salary of the employees in an educational institute.

When you need to reuse the procedural program in another application, a change in the application results in rewriting a large portion of the code. This results in decreased productivity and increased maintenance cost of the application. This was one of the reasons that led to the evolution of the object-oriented approach.

Published by Harsh Gupta - Tech Writer

I am a part time freelancer and writing is my hobby Some of my websites: http://www.GenericArticles.com http://www.JailBreakingiPhone.com  View profile

  • In procedural programming, you can use a subprogram at multiple locations within a program to perfor
  • Most of the data is shared as global that can be accessed from anywhere within the program.
A procedure or a subprogram is a set of commands that can be executed independently. In a program following procedural methodology, each step of a subprogram is linked to the previous step.

To comment, please sign in to your Yahoo! account, or sign up for a new account.