News for hackers. Stuff that matters.
Re:Ask HN: Relationship between OO and functional programming? by noelwelsh on Tuesday May 31, 2016 @03:32PM (#11809450)
I gave at talk about this at Scala Days NY, and I'll give it again in Berlin in a few weeks if I remember to actually book transport and a hotel. I'll just try and summarise here, because I don't have the energy or time to write out my talk :-)

I think FP and OO are fundamentally different in how they approach programming: the way they break down problems, what they consider to be good code, and so on. OO views code as small unit of encapsulated state communicating with one another. FP views code as a series of transformations. OO code is not good FP code, and vice versa.

On a lower level you can find many similarities. OO patterns are largely FP language features, from a time when knowledge of FP was not very widespread. At least five of the Gang of Four patterns are first class functions is disguise. Going the other way, a very typical pattern in functional programming is to build up a description of what should happen, and then have an "interpreter" actually execute that description. These interpreters often look like "coalgebraic" structures, which is an FP term for ... objects. Now isn't that interesting?

In summary, the techniques often look very similar if you squint, but the fundamental way they approach programming is very different.

That's a very quick sketch, which is somewhat hazy on the details. Apologies for the brevity and lack of nuance.

Re:Ask HN: Relationship between OO and functional programming? by honua on Tuesday May 31, 2016 @04:23PM (#11809896)
That's really neat you've given a talk about this. If by any chance the talk is recorded it'd be great to watch it!
Re:Ask HN: Relationship between OO and functional programming? by SatvikBeri on Tuesday May 31, 2016 @04:28PM (#11809933)
Looks like he's posted slides here: https://twitter.com/noelwelsh/status/730449315789934593

I also really liked his talk on probabilistic programming: https://www.youtube.com/watch?v=e1Ykk_CqKTY

Re:Ask HN: Relationship between OO and functional programming? by honua on Tuesday May 31, 2016 @04:48PM (#11810091)
Awesome, thanks!
Re:Ask HN: Relationship between OO and functional programming? by noelwelsh on Tuesday May 31, 2016 @04:32PM (#11809965)
The talk was recorded. I don't know when it will be online. The talk doesn't go heavily into details (no talk of coalgebras) but spends time trying to explore what good code means in the FP and OO paradigms.
Re:Ask HN: Relationship between OO and functional programming? by coreload on Wednesday June 01, 2016 @11:47AM (#11815354)
Well-defined object systems map objects to objects. Why would it be surprising that category theory can describe these things?

The questions for software development are about creativity and economy. The jury us still out on these to the best of my knowledge.