Closed DavsX closed 9 years ago
I haven't built anything very large using FP yet, but I'm very, very optimistic that it can do so quite well.
I hope to do exactly that in the near future. :)
Have you thought about how would you do it? The thing that gets me the most is connecting immutable datastructures, pure functions etc with for example relational databases in my head.
The other thing is: with immutable datastructures and passing data from function through function to function isn't there a lot of 'waste' of memory? Isn't that a performance issue with FP languages?
Have you wondered about these things? :)
The thing that gets me the most is connecting immutable datastructures, pure functions etc with for example relational databases in my head.
People do this all the time with Clojure, Haskell, and others. I believe the trick is to keep these icky mutable things (like the DOM or database) at the edges or borders of your program.
with immutable datastructures and passing data from function through function to function isn't there a lot of 'waste' of memory? Isn't that a performance issue with FP languages?
No, I don't think so. Clojure, for example, uses structural sharing.
More details: https://www.youtube.com/watch?v=dzP05hEDNvs
Interesting thought. So do you agree, that based on your response good (FP or other) software enforces these all kinds of good properties (in case of FP immutability and pure functions, in case of OOP low coupling etc.) on one edge of the program, while trying to push them to the other edge as far as it gets/makes sense/is practical?
Thanks for the video, I'll check it tomorrow, right now I'm hung up on 'Simple Made Easy'. Great recommendation, really pragmatic talk! :)
So do you agree, that based on your response good (FP or other) software enforces these all kinds of good properties (in case of FP immutability and pure functions, in case of OOP low coupling etc.) on one edge of the program, while trying to push them to the other edge as far as it gets/makes sense/is practical?
Sorry, not understanding what you're asking.
Glad you're liking the talk!
Let's try again then :)
What I was trying to say, is that apparently an FP architecture is not all about immutable structures and pure functions, but there are some (nessesary) sideeffects and state changing and the developer should try to limit these and/or push them to the edges of the architecture.
At least this is what I got from your answer. It got me thinking about how I used to try to go all-or-nothing (in my head atleast) with all these idioms/pracitces (TDD, decoupling, SOLID, pure functions) and instead I should maybe focus on doing them in an as-much-as-possible way.
Hi r00k, as lately you've been mentioning FP on twitter I'd like to ask if you think that FP is suitable to make whole projects in them (relatively bigger ones) or is it more suitable as a 'companion' to OOP, meaning that some parts of the project would be made in 'traditional OOP' style, others in FP?
As someone who is learning FP I'm curious about your experience/opinion.
Thanks! :)