4 ms·
Hmmm .. in imperative you start from one step and keep on thinking of next step and so on until you reach solution. This is more like left brain. In FP you brea
by ankurdhama 15y ago
Hmmm .. in imperative you start from one step and keep on thinking of next step and so on until you reach solution. This is more like left brain. In FP you break down the whole problem into parts but at the same time you also look at the overall problem and the you think about various composition to solve specific parts and how this evolve in complete solution, which for me seems like more of a right brain thing to come up with correct composable parts and how to glue them together to find the solution
- rprospero 15y agoI see where you're coming from. I guess my argument comes from your statement in imperative you start from one step and keep on *thinking of next step* I'd argue that the thinking there is far more right brained that the thinking in functional programming. When I'm doing functional programming, the steps are large enough that there's usually only one step I can take which won't go off into a horribly wrong direction. With imperative programming, the steps are much simpler, but also much smaller, so I can't think of just one step at a time. Instead, I need to think ten steps ahead, which feels like the kind of pattern matching that the right brain does.
- ankurdhama 15y agoMy point was that in FP you build things by composing existing things which require much more thinking it terms of trying different permutation and combinations at which the right brain is much more capable of. In general when I am doing FP I need to do lot of thinking and it requires some time whereas in imperative programming you can basically start coding as soon as you heard the problem. Ofcourse in the end the FP solution is much more elegant and simple