20

Dont lynch me or anything but...
What if OOP _isn't_ the best programming paradigm?

Comments
  • 19
    There is no best, only best for a given situation.
  • 5
    It depends on the situation. There are many cases in which a functional language (eg haskell) is better.
  • 1
    Paradigms often aren't incompatible y'know! Just avoid to object orient for the sake of object orienting, you'll be good.
  • 6
    I like to think like this about OOP: imagine a house, with no inner walls. So it's all a big room. You can put there a bed, an oven, a toilet... You can have everything there, but when you'll feel a bad smell, you won't know if it was the toilet or the stove. Is it practical? Not really...
    Now imagine you have walls. Now the kitchen is the kitchen, toilet toilet and so on. You don't have to worry about privacy when some people are over. And if something bad smells, you'll know where it came from.
    I like to think same about OOP.
  • 2
    @LicensedCrime no, you're assuming the choice is between OOP and spaghetti, there are other choices, lime functional programming!
  • 0
    It depends on the project. For a game I would prefer ECS over OOP just cause of the flexibility.
  • 1
    @SnuKies That is probably the best argument I've heard in layman's terms for using OOP over functional programming.
  • 1
    When writing my games I go with a data oriented approach. Sure, not the friendliest looking code but its fast and really you should be documenting anyway.

    Not OOP != Not organized
  • 1
    @DLMousey yeah, I guess if oop is all you know, other ways of thinking would be hard to follow
  • 0
    @DLMousey yeah, it did didn't it ;-)
  • 1
    OOP is just another tool, it can be used right, and you can saw your leg off. This tool comes with a User Guide called Design Patterns and Principles, which is the main reason a bunch of devs saw their metaphorical limbs off.
  • 0
    Probably isn't the "best", but is definitely the most commonly used simply because a lot of projects happen to be easily described by an OOP-based pattern.
Add Comment