Valid points, but not _the_ point. There is a big difference between allowing and supporting something. OO languages _support_ hidden inputs and outputs as well as programming by mutation. They _allow_ programming in a functional style, but you will have to be inventive for it. FP languages _support_ immutable values, referential transparency and all that. They _allow_ programming by mutation and hidden inputs and ou…
OOP vs. FP
11–20 of 30 posts
Re: OOP vs. FP
#12Is this guy talking about OO as described by smalltalk? Because he says that objects are bags of functions, not data, but in languages like java, c# and c++ objects are bags of both.
https://medium.com/@richardeng/domo-arigato-mr-smalltalk-aa8...
He's also the subject of this article: https://thenewstack.io/can-man-spark-renaissance-smalltalk-p..., which made the front page of HN a while back (https://news.ycombinator.com/item?id=13642947)
Re: OOP vs. FP
#13hmm, not so sure I agree to that extent. [To me,] FP is more about nobody owning the data. Everything operating on all the data. (Mostly) All data exposed and accessible. OOP is about certain classes owning data and limiting exposure to that data.
Re: OOP vs. FP
#14Re: OOP vs. FP
#15Earlier quoted context omitted.
I don't see that as much difference.
Take a class C. Alice extends class C with class A, which implements function a. Bob extends class C with class B, which implements function b. I have both Alice’s and Bob’s code, and I want to use both a and b. How can I do it? Of course, there are ways to do it – notably multiple inheritance, if your language supports it – but the point is, in a functional language, this question never even arises. You just import…
Inheritance is there if you need it. It's an available option.
Re: OOP vs. FP
#16Valid points, but not _the_ point. There is a big difference between allowing and supporting something. OO languages _support_ hidden inputs and outputs as well as programming by mutation. They _allow_ programming in a functional style, but you will have to be inventive for it. FP languages _support_ immutable values, referential transparency and all that. They _allow_ programming by mutation and hidden inputs and ou…
Exactly. Starting points matter. And for me, a starting point of "enforces immutable data" is a good one.
Re: OOP vs. FP
#17Valid points, but not _the_ point. There is a big difference between allowing and supporting something. OO languages _support_ hidden inputs and outputs as well as programming by mutation. They _allow_ programming in a functional style, but you will have to be inventive for it. FP languages _support_ immutable values, referential transparency and all that. They _allow_ programming by mutation and hidden inputs and ou…
Re: OOP vs. FP
#18Is this guy talking about OO as described by smalltalk? Because he says that objects are bags of functions, not data, but in languages like java, c# and c++ objects are bags of both.
Re: OOP vs. FP
#19Is this guy talking about OO as described by smalltalk? Because he says that objects are bags of functions, not data, but in languages like java, c# and c++ objects are bags of both.
It's Uncle Bob who says objects are bags of functions. And this is not specific to Smalltalk nor dynamic languages. In Java, C#, and C++, objects are still just bags of functions.
Re: OOP vs. FP
#20Is this guy talking about OO as described by smalltalk? Because he says that objects are bags of functions, not data, but in languages like java, c# and c++ objects are bags of both.
It's Uncle Bob who says objects are bags of functions. And this is not specific to Smalltalk nor dynamic languages. In Java, C#, and C++, objects are still just bags of functions.