+ 1
Why OOP is used these days?
When i browse over the internet, i often met the word 'OOP' and when i go through it, i know OOP stands for Object Oriented Programming and is used to make programmer easier. My question is, why OOP is used these days? i need to what exactly the function is. feel free to share your opinion
2 Answers
+ 3
before opp ,functional programing or procedural programing concept is used ,in which main problem a programmer get is that a code is very complex and most likely not editable or a softwere cant be updated very precisly.
so because of that a new concept came in present that is oop and it provides ability of abtraction ,encapsulation ,inheritance etc .
thats why oop is used now days
+ 8
It makes it easier for programmers to imitate real-life systems. This makes it easier to maintain your codes, as well as build logical solutions to problems, and also solutions which can be used as blueprints for solving other different problems as well. E.g.
class human
{
public: void eat();
void speak();
void exercise()
// and more dank stuff
private: int health;
int BP;
int PP;
float temp;
float HBR;
bool isAlive;
};
I now have a template for 'human' which can be used for different purposes.