From: James Gray Date: 2009-01-10T00:04:37+09:00 Subject: Re: functional programming On Jan 9, 2009, at 6:39 AM, andrea wrote: > But does it really make sense to program in a functional way in ruby?? That's a great question. Functional languages have been a hot topic lately and it seems with that comes the need to make all languages functional. We've seen plenty of that in Rubyland. Try to count the number of actor style networking libraries (heavily inspired by Erlang I'm guessing) we have now. But you've nailed the key question: is this right for Ruby? My feeling is probably not. Don't get me wrong. I like functional languages. I've learned a lot from using them even just a little. I think there are projects where I would prefer them. However, Ruby is almost a flat opposite to them in many ways. Ruby loves side effects and data is just about never locked down in Ruby. That's not bad, it's just Ruby. There may be times when we should adopt a functional approach here and there. but if you are trying to avoid calling standard iterators in Ruby because they aren't functional, you're trading Ruby advantages away for heavy Ruby minuses. Performance is just one example of this. If you are willing to make that trade, why not trade languages and get back to the things you want being an advantage? Of course, that's all just my opinion. I mean no offense. James Edward Gray II