This week I will start by talking about object-oriented
programming.
Let us start off by explaining what object-oriented
programming (OOP) is:
Programming is usually modeled around actions and logic. OOP,
however, uses the concepts of objects and data rather than the usual
programming model (actions and logic). These objects are data structures that
contain different types of data, capsulated within classes or objects. The code
itself is written in methods under every class instead of functions. One of the
major bonuses that come from using OOP is that the methods in the class can
modify the data held in the class. Computer programs in OOP are often designed
by making the different objects interact with one another to create the main
program.
OOP has really helped programmers to advance the world in
programming by making it easier to create your own classes and make them do
exactly what you want them to do. With OOP, you can create sub-classes of a
class without re-writing the _ _init_ _ method. By doing this, there is less
chance of humans making a copying error when re-typing the _ _init_ _ method. Since
every method in the class only uses the data established in the _ _init_ _
method, the other data in the main program is safe and will not be changed
while running different classes. This also benefits programmers in the way in
which, for example, two variables are the same, and the method only changes the
variable in its own class.
Thank you for spending you time reading my blog. Please
leave a comment below.
No comments:
Post a Comment