News for hackers. Stuff that matters.
Re:Where FP meets OO by amelius on Monday December 29, 2014 @08:23AM (#8809640)
I'm not sure that OO-ness is a desired property.

Alexander Stepanov, original creator of the STL:

"I find OOP technically unsound. It attempts to decompose the world in terms of interfaces that vary on a single type. To deal with the real problems you need multisorted algebras - families of interfaces that span multiple types. I find OOP philosophically unsound. It claims that everything is an object. Even if it is true it is not very interesting - saying that everything is an object is saying nothing at all. I find OOP methodologically wrong. It starts with classes. It is as if mathematicians would start with axioms. You do not start with axioms - you start with proofs. Only when you have found a bunch of related proofs, can you come up with axioms. You end with axioms. The same thing is true in programming: you have to start with interesting algorithms. Only when you understand them well, can you come up with an interface that will let them work."

More discussion:

http://www.quora.com/Was-object-oriented-programming-a-failu...

Re:Where FP meets OO by al2o3cr on Monday December 29, 2014 @10:02AM (#8810014)
"You do not start with axioms - you start with proofs. Only when you have found a bunch of related proofs, can you come up with axioms. You end with axioms."

Um, what? You have no FACTS to do proofs with without axioms; they are the fundamental statements one assumes to be true to define a logical system.

Somebody who insists that they need "multisorted algebras" while misunderstanding a fundamental definition in mathematical logic is exceptionally confused...

Re:Where FP meets OO by v64 on Monday December 29, 2014 @10:19AM (#8810080)
I interpreted this to be a top down vs bottom up argument.

In mathematics, we certainly have ZFC as an axiom system now, but mathematics was performed for thousands of years without a "stable" axiomatic base. For example, calculus was developed before the axiomatic delta-epsilon definition for limits was created. The math was developed first, and it was only after the fact that mathematicians went back and set the theory on a stable theoretical footing.

Therefore, I believe Stepanov suggests a bottom up approach: You write an algorithm that performs your work first, and then once you have that, you can refactor the code into classes that encapsulate the various parts of your existing algorithm.

Re:Where FP meets OO by innguest on Monday December 29, 2014 @10:47AM (#8810213)
The axioms were found much much later than a lot of the work had already been done. When Euclid wrote down his list of axioms do you think he was laying the ground for work yet to be done? No, the axioms were the synthesis he came up with by observing the work that had been done before by others.
Re:Where FP meets OO by seanmcdirmid on Monday December 29, 2014 @08:39AM (#8809693)
OO is more about naming and relating things than the fundamental truthiness of math (and likewise FP). They are just as much about communicating with humans when coming up with a solution as they are about actually getting the computer to act on the solution.

Algorithms don't even come into much play in many typical programming tasks, so the premise of Stepanov's observation is probably flawed (or assumes certain tasks).

Re:Where FP meets OO by ufo on Monday December 29, 2014 @09:56AM (#8809991)
I don't agree with that. Naming things and communicating well is something you have to do in every programming paradigm and is not specific to OOP.

IMO, if you want to see what OOP is really about you should focus on its unique features: inheritance, subtype polymorphism, etc.

Re:Where FP meets OO by seanmcdirmid on Monday December 29, 2014 @01:07PM (#8810933)
You mean, objects aren't really about objects, since every programming paradigm has them? Well yah, that is kind of the point: it is hard to not think in terms of them, that is what 100k years of evolved linguistic capabilities have given us.

If you want to focus on unique features, then do that instead; Stepanov's argument was focused on thinking, not checkmarks.

Re:Where FP meets OO by jowiar on Monday December 29, 2014 @11:30AM (#8810417)
To me, OOP is, first and foremost, about messages. Everything else is negotiable.
Re:Where FP meets OO by seanmcdirmid on Monday December 29, 2014 @07:23PM (#8812621)
Messages, communication, aren't they same thing, no? I don't agree with Alan Kay on this point; or perhaps I don't understand it correctly (it is just one sentence, he never really elaborates on it anywhere as far as I can find, the best I have found is [1]).

[1] http://c2.com/cgi/wiki?AlanKayOnMessaging

Re:Where FP meets OO by tracker1 on Monday December 29, 2014 @11:50AM (#8810519)
Messages, across boundaries is more FP than OO though... it actually adds complexity to do this in an OO paradigm.
Re:Where FP meets OO by Gurkenmaster on Monday January 05, 2015 @09:23AM (#8838870)
What do you mean with complexity?
Re:Where FP meets OO by dangoor on Monday December 29, 2014 @10:50AM (#8810224)
The original article referred to "true OO" which actually does't start with classes, but rather objects. The OP is talking about using functions that are grouped together in objects, so it's a different model than standard OO or class-based OO