Well, I guess maybe I'm the only one, but I enjoy FP as an adjunct to Object-Oriented. It is incredibly useful in our applications, even though lots of our FP-purity isn't enforced by the language.
Functional Programming is about transforming values in a stream-like manner. It gives you strong correctness guarantees from your compiler, and in any case where you want to turn data A into data B in a pipelining process, going as FP as you can manage doesn't seem to lead you wrong. I think the thing about state is that there are just too many cases where the overhead of "building" or "extracting" the state is huge. When you're dealing with a user interface, for example, there IS state--it's what the user is seeing on their screen.
But for anything involving pipelining, it's good stuff.
I love FP and only use OO when it makes sense to encapsulate data and functionality together, ie when writing simulations. When it gets to a GUI though it usually ends up horrible.
At the feet of the Great Monad, or, How the functional programming craze plays out • The Register
'Tell us about the great Functional Reformation of 2017!"'
'But whereas the prophetess of Apollo sniffed the hallucinatory gases that oozed into her musty cave, the prophet of functional programming preferred to hold court in the saloon bar of the Leaky Abstraction and Talbot. '
'"So you won't mind," said the Great Monad, "reminding me of the Seven Immutable Laws of FP, will you?"', "You're the kind that claims that C++ is a functional language, even though its VERY NAME describes the mutation of state."
'"And?" prompted the Great Monad, putting down his glass carefully, and pretending not to hear the outbreak of ill-suppressed sniggers around him. '
3 comments
1 u/SwiftLion 31 May 2017 19:03
Well, I guess maybe I'm the only one, but I enjoy FP as an adjunct to Object-Oriented. It is incredibly useful in our applications, even though lots of our FP-purity isn't enforced by the language.
Functional Programming is about transforming values in a stream-like manner. It gives you strong correctness guarantees from your compiler, and in any case where you want to turn data A into data B in a pipelining process, going as FP as you can manage doesn't seem to lead you wrong. I think the thing about state is that there are just too many cases where the overhead of "building" or "extracting" the state is huge. When you're dealing with a user interface, for example, there IS state--it's what the user is seeing on their screen.
But for anything involving pipelining, it's good stuff.
0 u/Atarian 01 Jun 2017 10:40
This is true.
I love FP and only use OO when it makes sense to encapsulate data and functionality together, ie when writing simulations. When it gets to a GUI though it usually ends up horrible.
It works well with web programming I find though.
0 u/derram 31 May 2017 17:32
https://archive.is/Izufo | :
'Tell us about the great Functional Reformation of 2017!"'
'But whereas the prophetess of Apollo sniffed the hallucinatory gases that oozed into her musty cave, the prophet of functional programming preferred to hold court in the saloon bar of the Leaky Abstraction and Talbot. '
'"So you won't mind," said the Great Monad, "reminding me of the Seven Immutable Laws of FP, will you?"', "You're the kind that claims that C++ is a functional language, even though its VERY NAME describes the mutation of state."
'"And?" prompted the Great Monad, putting down his glass carefully, and pretending not to hear the outbreak of ill-suppressed sniggers around him. '
This has been an automated message.