Is OOP really as bad as people make it out to be?
Is OOP really as bad as people make it out to be?
Use the right tool for the job.
Shit code is shit code in any language. Regarding OOP, good programmers don’t mind it, bad programmers don’t care about it, and great programmers use C
I don't know of any modern language that isn't OOP
interfaces are nice for encapsulation, streamlining your workflow
types ensure that you make fewer mistakes,
inheritance/polymorphism allows you to reuse and encapsulate more code
pic 1 is just an academic example of inheritance. it's a tiny part of OOP.
pic 2 is more of what a module would look like. but that's fine. you just put that into a box and don't touch the code anymore and only use its public interface.
OOP is only as helpful to not repeat yourself. doing any more work means that you are either relying on it too much, or are doing it wrong.
Exception handling isn't OOP exclusive, you autist.
Also, factory pattern is universally frowned upon. People try to avoid it as much as possible.
OOP exist to allow creating human-comprehensible yet robust systems. It is an extremely simple concept. If you're struggling with OOP you're basically an idiot who thinks he knows how the procedural programming looks like after only writing a shitty fizzbuzz solution.
In theory, no. In practice, yes.
Only if you write bad OOP, like me
Factory pattern is basically only needed in shitlangs that don’t support passing classes as arguments.
Left: Java
Right: C++