--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Designing a FP program often involves looking at the data first, then thinking about what transformations that the data needs in order to become what you want it to be. I like to think of functions as instructions about how to transform that data.This is overly simplistic, and I would definitely recommend some background reading/watching of videos.
FP has an ideally unidirectional flow of causality, whereas OOP has loops, where state flows backwards in the causal chain. A class instance is like a state machine (to my mind) and that machine moves through time, updating it's properties. (Banging on things in place)
FP allows you to more easily create an objective universe, where you control all states from the outside and have absolute control over those states. This also, however, requires more explicit definition of what you want to occur, because the context of your transformation is not implicit in the data itself.
OOP allows you to more easily forget about the complexities of the global, outside context and operate under the illusion that context is built into the instance - that the same "thing" is moving across the causal graph, through time. Unfortunately, as our programs become more complex this illusion breaks down and our efforts to hide the complexities of the outside context in looping state machines makes us in fact ignorant of too much. No, the class is not a duck. No, the method does not actually quack. It's convenient to pretend like it does, in the small, but the inside, subjective metaphor becomes a burden in the large.
So while FP sometimes requires more explicit definition of the desired transformations from one state to the next, you'll end up with a lot more hair on your head when working with large systems, if Rich and Stu's heads are any indication :)
John--