Object orientated programming refers to the programming paradigm involving "objects" that have their own data and functionalities, and interact with one another. It has been stated before that to learn OOP, one has to unlearn any programming that they had learned before. While this exaggerates the learning curve and degree of difference from procedural or "regular" programming, it does indeed capture the fact that OOP requires a different type of thinking, largely based upon how different objects interact with each other.
At first, it can be difficult for one to wrap their head around the notion of separate objects interacting with each other, or than in a program, one works with an instance of an object rather than the object itself. This type of programming becomes particularly useful when designing large programs, with the most immediately obvious reason being a more efficient organization of more readable code. More importantly however, in using instances of objects, OOP allows for multiple "objects" (as opposed to proper objects, ie classes), with the same behaviour without repeating code, as well as allowing them to interact with each other. Inheritance also allows for building objects off of existing, similar objects. For smaller, simpler programs however, OOP often presents itself as an unnecessary complication, resulting in extra work and code.
No comments:
Post a Comment