r҉ustic cy͠be̸rpu̵nk🤠🤖 is a user on mastodon.social. You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.
r҉ustic cy͠be̸rpu̵nk🤠🤖 @cypnk

class SenderFactoryFactoryFactory

· Web · 1 · 3

As far as I can tell, OOP has gone from paradigm to fetish

At this point, not only is it making code harder to understand, it's being used as a completely inappropriate cudgel to solve problems that really shouldn't exist in the first place

@cypnk initial problem: global state is bad.
OOP: let's have state all over the place, but don't worry it will be hidden in objects.
Seriously though OOP can be good if you adhere to SOLID principles. Over-abstraction is against Liskov subst. priciple.

@cypnk I have recently switched and have not regretted a second

@cypnk A lot of people swinging too far on the functional side of the pendulum recently. I think there's probably a sweet spot somewhere between, where we minimize held state, but when we run into inevitable complexity we can divide and conquer the same way we did in imperative languages.

So, for instance, a factory is probably a pure function, not an object. A Sender is probably also a pure function. But the underlying stream has complexity we don't need to understand to use efficiently:Object

@falkreon I agree completely

I think it's also possible to get lost in the project such that there's little outside perspective to say "that's enough". Most of these are written in-house so there's no way to get feedback until it's mostly finished

@saxnot Ah, but you must inherit Structure first, which inherits Ground, which in turn inherits Planet which in turn...

@cypnk ah yes of course. Can we make sure to only use one method per interface and then maybe aggregate them inside other interfaces?

Maybe this helps make our API more granular.

@cypnk That's a Java-ism, not an OOP-ism. Java's compiled and takes forever to compile, but projects want to be dynamically configured, so it gets these giant factory/XML frameworks instead of just using any of the 5000 interpreted languages that also run in the JVM.

Javascript and Python are more OOP than Java but have no FF madness because the config is just another script.

@cypnk PHP is the new Visual BASIC for Applications, and by "new" I mean 1993, and by "VBAfA" I mean virus-loader.