12
spl0
4y

Just because OO exists, it's not mandatory.

Some code would be 10(+) times simpler, more readable and more maintainable without it.

Comments
  • 1
    You'll learn, as you make your way through, that each problem has its own way to be solved.

    Some like to be solved by OOP, others only allow Functional, some are restricted to declarative, but in the end, all that matters is that you can perceive what approach you should take to tackle it.
  • 1
    So much this

    OO == funky action at a distance.

    Yeah right tool for the right job, only having small composable and testable functions that produce consistent outputs for the same inputs, so much win. Further not having state or mutation is just useful.
  • 1
    I dont see how a large project can exist nowadays and it was created using procedures purely (legacy code excluded). Procedural programming is simpler and works... up to a point. Then it just starts becoming more and more of a mess, especially in a team environment. So.. yes, you would do well without oop in a smaller one-person project, and no, you will just make a mess with globals and function names in a team on a large scale project. OOP is complicated until you figure out one important thing...OOP was never all about reuse, it was about separation of responsibility.
  • 0
    @arekxv I remember the OOP camp touting 'reuse' pretty heavily when it first appeared.

    I think the things you are talking about as being useful for large projects are the principles of information hiding, and I totally agree.

    Information hiding existed (and was implemented) long before OOP to solve 'the software crisis'.

    eg Languages like Modula-2, Ada83.
  • 1
    @arekxv I seem to remember a paper comparing projects and recording no productivity gains from procedural vs oo.

    But oo isn't the only alternative to procedural.
  • 2
    I should add that I appreciate OO and I actually like it in the right situation. But I'm noticing new developers are feeling the need to use it for EVERYTHING!
  • 2
    @spl0 I guess that's because:

    1. If you search how to code online, first results are based on OOP
    2. Even if they learn and get really good, sadly, they learnt how to think in that language, they didn't learn how to think algorithmically.
    3. The developer is comfortable and doesn't bother to learn another programming paradigms.

    I used to be like that, thinking OOP was "the 42" 😂
Add Comment