There are three key benefits to object-oriented programming: comprehensibility, reusability, and extensibility. Breaking code down into classes makes it more comprehensible by imposing a structure as programs get larger and larger. The ideal is to assemble object-oriented systems from prewritten classes and to make the required modifications to support the new requirements by using inheritance to derive new classes from the existing classes. The existing classes are reused as building blocks and not altered in any way. Creating systems from reusable components naturally leads to higher productivity, which is probably the most frequently cited benefit of object-oriented approaches. Object-oriented programming should also result in higher-quality systems. Classes that are being reused—having been tested and developed on earlier projects—are likely to contain fewer bugs than classes developed from scratch. Over the passage of time, bugs have been found and fixed in these classes, whereas a class that is written from scratch has yet to pass through the same bug detection and fixing process.
The features (encapsulation, inheritance, and polymorphism) of object-oriented programming also provide benefits. Encapsulation makes it easier to scale up from small systems to large systems. To a large extent, regardless of the size of the system, the developer is simply creating objects. Large systems might require more objects than small systems, but the level of complexity facing the developer is not significantly increased. Inheritance helps to improve the flexibility and extensibility of systems, hence reducing their costs to maintain. Deriving new classes from existing classes provides additional functionality and allows the extension of the software without altering the existing classes.
Finally, data hiding also leads to more secure systems. The state of an object can be modified only by its publicly exposed methods, which increases the predictability of object behavior.