News for hackers. Stuff that matters.
Re:Dear Developer, the Web Isn't About You by marcosdumay on Thursday December 20, 2018 @11:52AM (#18726515)
The problem with OOP patterns is not that they are complex. It's that you gain incredibly little by using them.
Re:Dear Developer, the Web Isn't About You by nradov on Thursday December 20, 2018 @12:14PM (#18726795)
You can gain a huge amount using OOP patterns, if your problem domain maps well to the OOP paradigm. I know this from personal experience on many projects.
Re:Dear Developer, the Web Isn't About You by marcosdumay on Thursday December 20, 2018 @05:16PM (#18729669)
Even on problems that map well into the OOP paradigm, the gain does not come from the standard patterns.

Proof of that is that in languages where there are alternative patterns (like Python), people rarely create a factory, they use functions that return classes; they don't use singletons, they just use module static variables; they don't create observers, just just gather callbacks on a list; and so on.

There are many less formal patterns that do add a lot of value. And there are syntactic and type level patterns that are great, but typically OOP programs use those less than code in other paradigms. OOP has one common less formal pattern that is very useful and less used elsewhere - it's the abstract API, but this one people on the internet mostly recommend not using, because it requires inheritance.

Re:Dear Developer, the Web Isn't About You by nradov on Thursday December 20, 2018 @06:35PM (#18730234)
There is no such thing as "standard patterns". There are a large number of different popular patterns which many developers have found useful for a broad range of uses.

Don't get too hung up on the implementation details in any particular language. A Python function that returns a class is just a factory by another name. The essential point is deferring the decision of which implementation class to instantiate until run time.

Inheritance is one way of handling abstract APIs, but not the only way (depending on language). And don't believe everything you read on the Internet. In some limited circumstances inheritance can be a great way to simply code and eliminate duplication, far outweighing any additional complexity it introduces.

Re:Dear Developer, the Web Isn't About You by josteink on Thursday December 20, 2018 @05:41PM (#18729867)
> OOP has one common less formal pattern that is very useful and less used elsewhere - it's the abstract API, but this one people on the internet mostly recommend not using, because it requires inheritance.

Or just use interfaces. As in "design by contract".

And that's just common sense programming wise, not some OOP specific solution.

Re:Dear Developer, the Web Isn't About You by TeMPOraL on Thursday December 20, 2018 @01:15PM (#18727437)
Yup. The actual issues with the design patterns come from a) most problems not mapping well to OOP, and b) patterns that exist only to compensate for low expressiveness of a language (e.g. all the patterns that compensate for not having proper closures).
Re:Dear Developer, the Web Isn't About You by josteink on Thursday December 20, 2018 @01:41PM (#18727717)
I agree with point B, but A is objectively wrong, borderline trolling.

You can successfully apply OOP and OOP design-patterns to a lot of problems and come up with equally functional solutions as you would with FP.

And for certain domains, better.