i2tutorials

CPP Programming – Tutorial

Programming Paradigms

 

The programming style is defined as a way to organize ideas based on a conceptual programming model and to use a suitable language for writing effective programs. The two main programming styles are:

No one programming style is more appropriate for all types of applications. For example, procedure-oriented programming would be better suited to the design of computational-intensive problems, and object-oriented programming style is better suited to a broad range of applications. It also acts as the architectural framework within which other paradigms are used.

 

Procedure-Oriented Programming (POP):

Conventional programming, which uses high-level languages such as COBOL, FORTRAN, and C, is known as procedural-based programming (POP). In this style, the problem is considered a series of things to do such as reading, calculating, and printing. Several functions are written to complete these tasks. Emphasis is given to functions.

 

Procedure-Oriented Programming

 

Procedural-based programming is essentially a list of instructions in the form of functions.  Although the focus is on function, very little attention is given to the data which are used by various functions.

When a program contains many functions, many important data elements are placed as global so that all functions can access them. Each function may have its own local data. The global data are more at risk of an involuntary change by a function. Not only does it make it very difficult to track which data is used by which function. While revising any of the data structures, we need to revise the functions that access the data. Another major disadvantage of the procedural approach is that it does not model the problems of the real world very well.

 

Some characteristics exhibited by POP:

 

Exit mobile version