Page 232 - Computer_Science_F5
P. 232
Table 4.1: Differences between POP and OOP
Procedure Oriented Programming Object Oriented Programming
(POP) (OOP)
The program is partitioned into smaller The program is divided into segments Chapter Four: Object oriented programming with C++
FOR ONLINE READING ONLY
components referred to as functions. known as objects.
The emphasis is not on data, but on The focus is on data in contrast to
functions and the sequence of actions to procedures or functions, as it emulates
be performed. real-world behaviour
POP follows top-down approach Follows bottom-up approach.
It lacks any access specifier. This includes access specifiers such as
public, private, and protected.
Data can flow unrestrictedly between Objects have the ability to relocate and
functions within the system. interact with one another by means of
member functions.
In POP, incorporating new data and Offers a convenient approach for adding
functions is not a straightforward task new data and methods
In most cases, functions rely on global The movement of data between classes
data for sharing, which can be accessed is not as straightforward. Instead, data
without restrictions across different can be designated as public or private,
functions within the system enabling us to control its accessibility
and restrict its flow between classes
It lacks a proper mechanism for hiding OOP provides data hiding, and it is
data , making it less secure. more secure.
It is impossible to perform overloading. Overloading is possible and achievable
through both function overloading and
operator overloading.
Examples include C, VB (that is, VB6), Examples include:
FORTRAN, Pascal C++, JAVA, VB.NET, C#.NET, Python,
JavaScript, Ruby.
223
Student’s Book Form Five
Computer Science Form 5.indd 223 23/07/2024 12:33

