Object Oriented Programming

in #oop8 years ago (edited)

What is object oriented programming? Why is it important?

Object Oriented Programming is a method of coding, often dealing with data organization. The way I like to think about OOP is that it uses classes and therefore objects to organize data in ways that make data analysis easier. Features of OPP languages include Objects and classes, Encapsulation, Inheritance, Polymorphism etc. These features are very important as they allow for code reuse, a very useful benefit in modern coding practices. One wants to reuse as much code as possible and keep their data out of the user's hands, and that is what many of these features allow for.

work-731198_960_720.jpg

Objects and Classes -


Objects and classes are very useful. They are user created files that handle very general processes with limited functionality. They can be something as simple as a circle class or as complex as a car class. An object is just a "creation" of your class. One can "create" a car object which will treat your car as any other datatype, except one can access functions they write for these classes often by using object name, a dot operator and the function name. These are really beneficial for solving real world problems such as automated deliveries. One can make truck objects and load into them parcel objects. It makes things a whole lot easier.

door-2287836_960_720.jpg

Encapsulation -


Just a form of abstraction where a programmer can make certain data private and only allow few people to access the data. This is a great security measure that is often overlooked. The last thing a programmer wants is to create code that users can accidentally manipulate the data because every running program could freely access and change the data.

girl-1641215_960_720.jpg

Inheritance && Polymorphism -


Inheritance allows one to create parent and child classes and make it so that child classes can use parent class functions and child class functions concurrently. This clearly promotes code reuse as one can create an inheritance relationship where multiple children classes can use the same once written function in the parent class.
Polymorphism allows one to store all different children objects into one data structure by using an array or a vector of the parent class pointers.

There are many more ideas to explore like recursion and templates but these are the core benefits of OOP programming. It is definitely a good concept to understand as a computer science major living in the modern era of data. I also feel that it is a really good way to start programming as I find it easier to use correlation to real life options to solve real life problems with code. What do you think, is Object oriented programming for you, is there anything I missed, Do you like this format of writing more than my previous articles?

Please leave a comment below and UPVOTE !!!!

Coin Marketplace

STEEM 0.20
TRX 0.25
JST 0.038
BTC 97445.74
ETH 3477.06
USDT 1.00
SBD 3.16