3 ms·
I also had a reaction when I started using Ruby and being introduced to functional programming concepts. I read blog posts http://notes-on-haskell.blogspot.com
by iamwil 18y ago
I also had a reaction when I started using Ruby and being introduced to functional programming concepts. I read blog posts http://notes-on-haskell.blogspot.com/2007/02/whats-wrong-with-for-loop.html http://notes-on-haskell.blogspot.com/2007/02/whats-wrong-wit... about people saying you don't really need for loops. I thought...well, how do you get anything done?
Ends up that most things you care about can be done with iterators like each, map, and inject (like a fold). On occasion, you'll need to break out the indicies, but for most things you don't need them. Raganwald's talked about unfolding, which is pretty interesting as well. I suggest you go and check it out, if not him making a comment about it here.