Why we are Using OOPS concepts? Before that method which method were used? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Why we are Using OOPS concepts? Before that method which method were used?

7th May 2019, 12:52 PM
Vijith Krishnan S
Vijith Krishnan S - avatar
7 Answers
+ 24
I think I read somewhere we use object-oriented programing because it's easier to maintain large programs.
7th May 2019, 3:22 PM
ron
+ 3
when the code grows to an extent that functional programming becomes hard to maintain. abstraction helps in areas such as creating namespace for grouping properties and methods to ease maintenance.
7th May 2019, 1:29 PM
Gordon
Gordon - avatar
+ 3
before oop, they used procedural programming
7th May 2019, 6:49 PM
Logomonic Learning
Logomonic Learning - avatar
+ 2
Before Oops we were used function oriented concepts but that is not fair, in that concept we have lots of disadvantages for example it can't find the error line exactly, and can't run a separate part of program, that's too large to type.. So we are using Oops to compare a real time entities as our programical concepts..
7th May 2019, 1:36 PM
Vijith Krishnan S
Vijith Krishnan S - avatar
+ 2
Imagine you were creating a game and needed to implement several dozens of enemies with different appearances and values (strength, speed, etc.) OOP allows you to just create an "enemy" class that contains all those attributes and sets them to random values on creation. This way you can just have enemies spawning all the time and you can tweak all of them with just very little code. I think this would be rather difficult when done purely functional. But I am also not super experienced.
7th May 2019, 3:30 PM
Majenga
Majenga - avatar
+ 1
~ swim ~, yeah, why OOPS, not how. I had the same doubts: 'What is it even good for? Why don't we just write functions and be done with it?' I struggled with that for a while so I can empathize.
7th May 2019, 1:29 PM
HonFu
HonFu - avatar
0
The tutorials don't go very deep, so some doubt might remain what it's even about (even if we technically know how to set it up).
7th May 2019, 1:22 PM
HonFu
HonFu - avatar