Need of Object-Oriented Programming
Object-oriented programming was developed because limitations were discovered in earlier approaches to programming. To appreciate what OOP does, we need to understand what these limitations are and how they arose from traditional programming languages.
1.Procedural Languages:
C, Pascal, FORTRAN, and similar languages are procedural languages. That is, each statement in the language tells the computer to do something: Get some input, add these numbers, divide by six, display that output. A program in a procedural language is a list of instructions. For very small programs, no other organizing principle (often called a paradigm) is needed. The programmer creates the list of instructions, and the computer carries them out.
2. Problems with Structured Programming
As programs grow ever larger and more complex, even the structured programming approach begins to show signs of strain. You may have heard about, or been involved in, horror stories of program development. The project is too complex, the schedule slips, more programmers are added, complexity increases, costs skyrocket, the schedule slips further, and disaster ensues.
3.Division into Functions
4.Unrestricted Access
5.Real-World Modeling
Characteristics of Object-Oriented Languages
- Objects
- Classes
- Inheritance
- Reusability
- Creating New Data Types
- Polymorphism and Overloading