Object-oriented
programming (OOP) can be defined as a style of programming in which both data
and behaviour are combined into "objects", which are then manipulated
accordingly. OOP is a significant step forward in the field of computer
science, going beyond the capabilities of procedural programming, which was the
programming style that preceded OOP. In procedural programming, methods were
written to manipulate data, rather than packaging both methods and data
together to be dealt with simultaneously. The usefulness of OOP is similar to
the concept of vectors from mathematics, which package two types of information
(magnitude and direction) to allow for more efficient calculations. As well,
with OOP, combining both data and variables into one "object" allows
the data and functions to work as and be worked on as one single entity.
Perhaps the most powerful thing about OOP is that it is closer to reality than procedural
programming. In the world around us, we can see many examples of objects (e.g.
cars) with data (e.g. windows, wheels) and behaviour (e.g. driving, opening
windows, activating windshield wipers). Ultimately, programming is the use of
computers to reconstruct and solve real-world problems, and so, as a closer
representation of the real world, OOP is a powerful tool for computer
scientists everywhere.
No comments:
Post a Comment