* “Beauty of the code is the ultimate defense against complexity”*
For those leading a so called “dev” life, Object Oriented Programming (OOP) is just a merely a programming methodology to encapsulate data. They find OOP complex and procedural programming paradigm’s easier with just mere functions and loops. But OOP has so much relation to our everyday life and it is the only programming technique that we can experience in real time. Just take a stroll around your house keeping the basic concepts of OOP in mind (classes, inheritance, polymorphism….:)). Did u observe something??? We’ll …..You saw a class named “family” with your grandparents, parents, siblings (as well as you..!:3) as members of the class and what do they do in the family? They love, care and support each other. So technically , methods like love(), care(), support() can be applied to the members of the class. The whole data is wrapped up into a class named family. After some years the next generation of this family comes into existence. So the next generation will be the objects of this class family (eg: object named nextgen) which will acquire the same characteristics and behavior of the class. Moreover, other classes can be inherited from the class family. This is where the “beauty of OOP” lies….a wide connection to reality, that can be observed and experienced…!!
Too much reality talks right..?? Lets try to understand what the “real” OOP is. The main utility of OOP is avoiding “code redundancy”.(for those who are not into programming may haven’t heard about this i.e, writing the same code again and again). For the class, its objects can be created which are a blueprint of the class. So, the objects created can be used instead of writing the whole class again. A large section of the software developers hate this object oriented programming (but there exists some companies who promote OOP ;)).This is mainly because focus is on how the objects behave and not the code required to tell them how to behave. In other words, OOP code is based on how the objects of the class interact each other. In the case of the normal programming paradigm just actions are done on data to produce the desired output by applying inbuilt functions and loops. But in OOP, it gives details about what are the properties of data, how they exist and all such information about the properties of data which the developers never think about. Another advantage is that it incorporates hierarchical thinking.Every theory in this world has a bright side and a dark side which is usually forgotten. But as a person who loves programming it is his duty to analyse the drawbacks and bring them to the bright side. So, Object Oriented Programming has also many disadvantages which has not been tried to correct over these years, making OOP less popular. Normally , all the OOP programs are lengthy and involves the use of many members which consumes memory. In addition, this reduces the execution speed. Another disadvantage is that , to write and execute OOP programs proper OOP knowledge is required i.e,techniques like encapsulating data into a class,object creation and using them in appropriate places,derived classes…etc.If the procedures are not properly known and understood the desired project maybe futile.
Even though , OOP posses this many disadvantages…if it is properly understood and used in everyday practice OOP as sweet as a piece of cake. Readers, Try more object oriented techniques than following the conventional ways…Explore the new arenas of programming…!! :3
Don’t forget to leave your valuable comments.
Subscribe to Code Rewritten
Get the latest posts delivered right to your inbox