<< Chapter < Page | Chapter >> Page > |
"In procedural programming, the programmer constructs procedures (or functions, as they are called in C++). The procedures are collections of programming statements that perform a specific task. The procedures each contain their own variables and commonly share variables with other procedures. Procedural programming is centered on the procedure or function." Tony Gaddis, Judy Walters and Godfrey Muganda, Starting Out with C++ Early Objects Sixth Edition (United States of America: Pearson – Addison Wesley, 2008) 22. For decades (1950s to through the 1980s) most programming was taught as procedural programming . Coupled with the imposition of using standardized control structures in the late 1960s, we have what is typically called modular structured programming .
Another, equally valid approach to programming is object-oriented programming or OOP. It was introduced in the mid 1980s and was widely accepted as a programming approach by the early 1990s. The first languages to introduce OOP to the masses were C++ and Java. Shortly after their introduction, there were American National Standards Institute (ANSI) standards established for those languages. Today, C++ and Java are widely used.
"The primary differences between the two approaches is their use of data. In a procedural program, the design centers around the rules or procedures for processing the data. The procedures, implemented as functions in C++, are the focus of the design. The data objects are passed to the functions as parameters. The key question is how the functions will transform the data they receive for either storage or further processing. Procedural programming has been the mainstay of computer science since its beginning and is still heavily used today.
In an object-oriented program, abbreviated OOP, the design centers around objects that contain (encapsulate) the data and the necessary functions to process the data. In OOP, the objects own the functions that process the data." Behrouz A. Forouzan and Richard F. Gilberg, Computer Science A Structured Approach using C++ Second Edition (United States of America: Thompson – Brooks/Cole, 2004) 156.
"Object-oriented programming … is centered on the object. An object is a programming element that contains data and the procedures that operate on the data. The objects contain, within themselves, both the information and the ability to manipulate the information." Tony Gaddis, Judy Walters and Godfrey Muganda, Starting Out with C++ Early Objects Sixth Edition (United States of America: Pearson – Addison Wesley, 2008) 22.
To help complicate the picture, the C++ programming language can be used (and is used) to write either a procedural program (modular structured program) or an object-oriented program. Some items used by those writing procedural programs in C++ are in fact objects. Examples include:
Objects are implemented with a "class" data type; which is a complex or derived data type. Implementation details will not be presented in the module.
Many students will learn modular structured programming before learning object-oriented programming. The common way of teaching programming fundamentals is to cover them or divide them into three courses, usually covered in this order:
The following items learned in modular structured programming flow into the learning of object-oriented programming:
Notification Switch
Would you like to follow the 'Programming fundamentals - a modular structured approach using c++' conversation and receive update notifications?