6 ms·
This article is not really worth reading if you've read any criticism of object-oriented programming from the last 3 decades. Except maybe the reference proble
by wvenable 5y ago
This article is not really worth reading if you've read any criticism of object-oriented programming from the last 3 decades. Except maybe the reference problem related to encapsulation -- that's just wrong.
I really don't have these kinds of problems; it's likely due to experience. It's not that I don't use inheritance, encapsulation, polymorphism, etc. I do. And when I do, it works exactly as it's supposed to. I don't over-use it, I don't use it when it's not appropriate. This is the same with functional concepts as well.
Object-oriented programming is the most successful programming paradigm in history. But you don't get to the front page of hacker news with that information.
- deltaonefour 5y ago>Object-oriented programming is the most successful programming paradigm in history No it's not. Likely the most popular paradigm. Not the most successful. It's like saying Null is the most successful concept in all of computer science.
- wvenable 5y agoObject-oriented concepts are everywhere, even in software products like the Linux kernel, that don't use an object-oriented language. I'd go so far as to argue that 99.999% of all software is object-oriented (and I'm probably missing a few nines). But you're just saying that's merely popular and not successful? That seems extremely flippant.
- deltaonefour 5y agoNull is more popular than OOP. It's also something all programmers can agree is a huge mistake. But this concept is replicated literally everywhere. See: https://www.reddit.com/r/AskComputerScience/comments/bhgtzp/why_did_tony_hoare_apologize_for_inventing_the/ https://www.reddit.com/r/AskComputerScience/comments/bhgtzp/... People in general are stupid. They get onto hype trains they develop biases and they vote for Trump and try to invade the Whitehouse. Programmers are people. Hence why stupid concepts can propagate throughout the community. (Not saying OOP is stupid, just saying that something being popular doesn't negate it from being placed in the stupid bucket.)
- wvenable 5y agoI'm not saying OOP is popular, I'm saying it's successful. You're not making an argument against that at all. You're saying it's popular (not what I'm saying) and bad things can be popular. So what! Good things can also be popular. In fact, good things are often popular.
- readthenotes1 5y agoLike tobacco, sugar, whisky, and caffeine, brussel sprouts, cod liver oil, ...
- deltaonefour 5y ago>I'm not saying OOP is popular, I'm saying it's successful.You're not making an argument against that at all. No. No. I am NOT making an argument saying is OOP is NOT Successful. I never Made such an argument EVER. What I am saying is that your argument is completely Invalid. I am saying you can make no such argument for OOP being successful. Big difference. I make no argument on anything other than saying your argument CANNOT be made with your given evidence. The evidence you present only supports OOP's popularity. Not it's success. Unless you count popularity as success. The argument can still be made that for every application of OOP on ANY project a better non-OOP solution could have been made. This is a possibility. My post only opens this as a possibility and dismisses your post as the absolute truth.
- wvenable 5y agoThe flaw in your argument is that those non-OOP solutions were not made. They don't exist. The idea that some other programming paradigm is more successful based on products that don't exist is ridiculous.
- deltaonefour 5y agoLinux is not OOP. The react and redux pattern eschews OOP. (You can use OOP components but the overarching pattern is functional) Many solutions are made without OOP.
- deleted 5y ago[deleted]
- Zababa 5y ago> Object-oriented programming is the most successful programming paradigm in history. I don't think it is. The vast majority of code is imperative, with sometimes classes here and there, and these days with sometimes higher-order functions here and there, and with sometimes declarative programming (SQL and stuff like that). But the core is imperative code.
- wvenable 5y agoImperative code is the basis for almost everything -- whether it be OOP or functional or big ball of mud. It's not a significant distinction for this discussion.
- Zababa 5y agoIt is actually, and it is not the basis for almost everything. Functional code is usually declarative instead of being imperative. SQL is declarative, not imperative. The vast majority of the code written is imperative. It uses "if" instead of polymorphism for example, it doesn't rely on message passing or encapsulation or anything like that. You can't just ignore a paradigm and say that the second one is the most used.
- deltaonefour 5y ago>Imperative code is the basis for almost everything -- whether it be OOP or functional or big ball of mud Wrong. Imperative is NOT functional. You cannot have both functional and imperative. They are literally opposites. You CAN technically have both functional and OOP. However removing mutation from OOP removes the concept of setters and many associated "Design patterns" that are part of OOP.... so it's like removing the ignition from all car engines and still saying that the car is a car. Many people don't understand what functional programming really is. Allow me to elucidate. Whatever program you can write on a single expression. That is a functional statement. If you write multiple functional statements... the code becomes imperative. A functional program is an imperative program with ONE expression total. To write a functional program is to place your entire program ON ONE line. That's what functional is. Now you may have heard that all you need to do is make everything in an imperative immutable for the program to be "functional." This is true. Turns out an immutable imperative program is isomorphic to a functional program. See this: A = 2 + 2 C = A + 4 (immutable + imperative) is equivalent to: C = 2 + 2 + 4 (functional) However if you add mutation the isomorphism is lost. A = 2 + 2 C = A + 4 A = 3 You can no longer do the substitution above. Because of this isomorphism; to have any real linguistic meaning and differences between the words "functional" and "imperative" means that imperative programs MUST include reassignment. You can reassign a new value to an old variable in imperative programming and such a concept is literally impossible in a functional program because functional programs are just one line expressions. in FP all variable names are simply aliases or macro shortcut expansions. In imperative programs variables are mutating entities.