A Comparative Analysis of Structured and Object-Oriented Programming Methods
* Corresponding Author: Asagba, Prince Oghenekaro
45
Again, object-oriented programming is a superset of
structured programming. A pseudo code of a
structured programming is as follows:
... Program start
var
var
var
function {...}
function {...}
function {...}
main {...}
... Program End
Here, you have units of code which operate on
variables and are called in references to those
variables, to follow a structure, acting on those
variables.
A pseudo code of an object oriented programming is
as follows:
... Program start
Object {
Var
Var
function {...}
function {...}
function {...}
}
var
var
function {...}
main [...}
... Program End
Variables can be objects, which have their own data
and functions. Thus, instead of referencing a function
(a block of code) and telling it to operate on a
variable q, you reference an object and tell it to
perform an operation, most often on itself, specific to
itself, using its own data. Instead of creating units on
them, you create objects and have them perform
operations (on themselves) (Booch, 1986).
Dostları ilə paylaş: