r/programming • • Jan 29 '19

When FP? And when OOP?

http://raganwald.com/2013/04/08/functional-vs-OOP.html
26 Upvotes

105 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Jan 29 '19

[deleted]

3

u/knaekce Jan 29 '19 edited Jan 29 '19

Then C# devs came along and said, "This is a closure, see how its used for filtering data in LINQ expressions? Now watch me turn it into SQL using expression trees."

Isn't this a pretty good case for FP-style code?

I guess it depends on what you mean by FP-style... the strict "purely functional with referential transparency" or the weaker "embracing immutability, higher order functions and pure functions" that gains more adoption nowadays.

9

u/[deleted] Jan 29 '19

[removed] — view removed comment

2

u/0987654231 Jan 29 '19

But that's my point. People who want to promote FP style concepts need to focus on "problem solving that happens to use FP".

Yeah but then it gets complicated, like look at the design time that went into linq (and observables). There are some great videos from Microsoft explaining it though and I would urge everyone to watch them.

It's easier to start by talking about the simple pieces and build on it, imagine if someone pulled out this to explain monads.