answersLogoWhite

0

OOP, or Object-Oriented Programming, uses data models to represent real-world data. This has an advantage over traditional programming as it helps developers visualize data in real-world terms, as well as allowing those objects to react to events as real-world objects would react, given the proper programming. In a non-OOP program, for example, a car running into a wall would have to be detected by some common code. This might lead to odd bugs depending on how the model is laid out. With OOP, the car can simply notify the wall that there was a collision, and the wall would take damage, and the car would likewise take damage. Any bugs would be limited to a very choice area of code.

OOP also grants code simplification, commonly done by grouping together similar objects. A piece of software might have a generic notion of an airplane, for example, as well as specific types of planes that have different accelerations, maximum velocity, fuel capacity and usage, and lift, thrust, and drag parameters. Simply calling one common function reduces the complexity of determining which type of logic should be applied to a given airplane, as each airplane "knows" how to apply the logic uniquely as it applies to itself.

OOP can also encourage code reuse by grouping together common functions in a parent object, and child objects can add additional logic unique to themselves while still taking advantage of the common ancestor methods.

User Avatar

Wiki User

12y ago

What else can I help you with?