|
|
|
|
|
by kmill
1013 days ago
|
|
Currying is pretty much just a convenient way to write a one-constructor one-method class. It's a parameterized version of the command pattern. That said, if you're using a language with classes you may as well stick with those and omit the syntactic sugar from your diet. I find functional programming useful though because it can shorten code in a way where you can get a better view of the big picture and easily make sweeping changes. But it's also easy to write in a way that's too "perfect" (i.e. resistant to change) and incomprehensible. Though I'm not sure the total incomprehensibility is generally any worse than an enterprise Java codebase -- local readability might only give you the illusion that the whole system is understandable. Still, if you don't enjoy reading code in a certain style it makes for hard reading! |
|
Here's a nice talk on the subject: https://www.youtube.com/watch?v=sfYA0HCWgqQ
and slides: https://fsharpforfunandprofit.com/pipeline/
This "looser" way of doing things tends to be more popular in the F# community, which isn't terribly fond of those rigid crystalline structures that you get in other corners of the FP community. Though I'd also point out that, even in Haskell, ways of programming that lead to incomprehensible and resistant-to-change code are often viewed as a sign of inexperience by more seasoned developers. There's a lot of truth in this joke: http://pages.cpsc.ucalgary.ca/~robin/class/449/Evolution.htm