5 ms·
This is a bit like the "Islam is a religion of peace" discourse. I'm sure it is, but: OOP as actually implemented and found in the wild isn't about Smalltalk o
by thraway-burnout 8y ago
This is a bit like the "Islam is a religion of peace" discourse. I'm sure it is, but:
OOP as actually implemented and found in the wild isn't about Smalltalk or message passing. It's about transforming functions into methods by unnecessarily wrapping behaviour in classes, as an example of cargo-cult programming.
OOP the idea is great. How do you actually find it in the world?
- depressed 8y agoIf functional programming were implemented as widely and abused as much as OOP is, would it really fare any better?
- slx26 8y agoexactly, I feel the same way. OOP is often criticised from functional programming, but also from data-driven programming, for example. You never hear functional programming advocates criticise data-driven programming. The use cases are so different that it wouldn't make sense. To use OOP properly is probably as complicated as doing functional programming or data-driven programming properly. The "problem" is that the learning curve is much less steep and the use-cases more extense, so obviously there's a lot more people misusing it.
- blattimwind 8y agoI've seen data-driven code and it is full of OOP. Those are hardly orthogonal concepts. Arguably DD (on the pedal to the metal C/C++ level) doesn't quite match the OOP choir in terms of looks.
- slx26 8y agoI totally agree, and I believe any serious programmer should have at least some basic knowledge of the three "paradigms", as the core concepts are relevant in all cases, and there are many techniques that can be applied in different "paradigms". I didn't start talking about it in order to keep the comment short, but maybe it was a bit confusing.
- ummonk 8y agoYou can already see examples of this. Take callback hell. Opaque callbacks are the functional equivalent of goto statements. Also, many functional programmers, particularly Haskell programmers, seem not to care about readability and maintainability. They're focused on maximizing their own productivity as an individual coder, and writing cool concise and abstracted code that might not actually be easy for another engineer to understand and modify. The difference though is that good functional programming is still quite common whereas good object oriented programming seems to be rare (the one exception being microservices).
- axlprose 8y ago>particularly Haskell programmers, seem not to care about readability and maintainability Say what you want about the foreign-ness of the syntax, but Haskell code is some of the most maintainable code out there. I can often times dive into another person's haskell code and grok it more easily than the equivalent code in a "friendlier" language like python or ruby, nevermind a more comparable language like scala. Haskell is also a breeze to refactor, the compiler and type system make changing and moving arbitrary chunks of code around pretty straight-forward, even when the code is using abstractions you're not familiar with; something which cannot be said for many other languages. The biggest downside to haskell (apart from the learning curve) is having to deal with cabal+stack.
- marmaduke 8y ago> Opaque callbacks are the functional equivalent of goto statements in some sense they are worse because you can't just grep for the call site of an anonymous closure, like you can for a goto, it could be almost anywhere in the code base
- psgibbs 8y agoI've seen plenty of junior engineers who read a FP blog post, and start arguing about 'purity' and the need to refactor lots of code – without having any clue that pure functions are useful regardless of other coding paradigms / architectural decisions.
- spronkey 7y agoI'm very much in OOP-land when it comes to architecture at large, but a good portion of my code these days could be summarised as: using a 'classic' OO language to namespace pure functions.
- heavenlyblue 8y agoOr rather, it’s exactly as Islam is: it is a religion of peace and the politicians use the religion as a way to unite a bunch of poor people against someone else. Just like communism was used against capitalism in order to justify positions of power in the USSR. You are arguing tribal consensus rather that arguing important points. OOP in it’s essence is Akka actor model. Is that not considered a powerful FP framework? And please don’t tell me that the definition of OOP is what my recruiter tells me: it’s like trying to philosophise the meaning of life from the concept if Schroedinger’s cat when you have no idea of the underlying mathematics.
- blattimwind 8y ago> How do you actually find it in the world? It works. It is a sufficiently good model for many domains, even though it obviously is "impure" by combining the domain model and generally a whole lot of implementation details nee requirements. It clearly is an unreasonably effective strategy that has no solid theoretical footing, yet that does not prevent it from working in practice.
- abdulhaq 8y agoIf you're unclear on who is peaceful and who is aggressive, take a look at whose army is in whose country.
- myWindoonn 8y agoE [0] doesn't have classes or inheritance. It has messages and message-passing, and objects are genuinely encapsulated. A cousin comment notes that true objects are often called "actors". This is fine, but people who do this without an understanding of this history may come to miss out entirely on objects, only seeing what Erlang and Elm have to offer and not E. As a hint, try removing the meme entirely from your inventory for a bit: For the next week, whenever you think or say "object-oriented", interrupt yourself and instead think about what specific language feature, be it classes or inheritance or whatever, you actually wanted to reference. [0] http://erights.org/ http://erights.org/