3 ms·
I always think the best argument for OOP is avoiding name space collisions - with procedural programs you have a bunch of functions that could be named the same
by chadcmulligan 5y ago
I always think the best argument for OOP is avoiding name space collisions - with procedural programs you have a bunch of functions that could be named the same - how do you separate them? OOP gives you the ability to wrap things together - their variables along with the methods that make sense for the objects - little collections of things that go together. Then once you have an object, sometimes you'll want to make a method work a bit different in different circumstances - inheritance solves this. Sometimes you'll want a bunch of objects that aren't really in an inheritance hierarchy to have some features the same - so interfaces (protocols) are born.
- _dain_ 5y agoIsn't that just polymorphism? There are lots of ways to get that.
- chadcmulligan 5y agodon't think so - https://stackify.com/oop-concept-polymorphism/ https://stackify.com/oop-concept-polymorphism/