Object- oriented programming today is the basis of computer science.
In simple terms I would like to explain it with an example.
First of all think that why are we all doing programming ? and answer to this question is to solve real life problems, to save human efforts and time.
So, imagine you are the one who have the responsibility to add cash in the ATM machine as a worker.
So, you need to apply some logic that how many notes of 500 , 2000 or 100 you need to keep there, so the demands of the person taking out money is full filled.
Here come the approach to object- oriented programming.
Imagine yourself as an object in this real world. So you have some characteristics like height, weight etc. And you take part in solving real world problems.
On OOP the object is represented by its data, its behavior, and functions associated with it .
Simple and common example is apple is an object of class fruits and have features like red color, sweet taste etc.
OOP concept includes the 2 basic terms CLASS AND OBJECT.
For example C language uses procedural approach, the program will be executed in the flow written by the programmer.
But, using C++ or java language you can divide the problem into class and object approach and solve using functions and other features of object- oriented programming.
Now to solve the real life complex problems, object-oriented programming it provides the following features to the users:
1- DATA ABSTRACTION
Showing only the essential details hiding other details, like when you turn a switch on you just press the button but you are unaware of the wiring and connections inside.
When one class can inherit the features of base class or parent class.
It is the ability of an object to take on many forms.
The most common use of polymorphism in OOP occurs when a parent class reference is used to refer to a child class object.
Wrapping up data and functions into one unit.
We divide the program into small units to reduce the degree of complexity, and use these modules again and again according to the need of the programmer.
A lot of developers criticize the object-oriented programming model for multiple reasons.
The largest concern is that OOP overemphasizes the data component of software development and does not focus enough on computation or algorithms.
Additionally, OOP code may be more complicated to write and take longer to compile.
Alternative methods to OOP include:
- functional programming
- structured programming
- imperative programming
Most advanced programming languages give developers the option to combine these models.
Even bad code can function. But if code isn’t clean, it can bring a development organization to its knees.
Every year, countless hours and significant resources are lost because of poorly written code. But it doesn’t have to be that way.
Noted software expert Robert C. Martin presents a revolutionary paradigm with Clean Code: A Handbook of Agile Software Craftsmanship.
Martin has teamed up with his colleagues from Object Mentor to distill their best agile practice of cleaning code on the fly into a book that will instill within you the values of a software craftsman and make you a better programmer, but only if you work at it.
Get your copy using the link below:
Some related articles you might interest in :