+ 2
Why we are Using OOPS concepts? Before that method which method were used?
9 Answers
+ 24
I think I read somewhere we use object-oriented programing because it's easier to maintain large programs.
+ 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.
+ 3
before oop, they used procedural programming
+ 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..
+ 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.
+ 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.
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).