In languages which are functionally-focused enough that tail call optimization can be relied upon, higher-order functions are usually available and a better solution. See my post higher up.
I prefer to use recursion in a lot of cases in languages with pattern matching in function heads (e.g. Erlang or Elixir), particularly when each "case" deals with the accumulated state differently, which is more often than not.
When you are doing simple maps/filters whatever, then yeah, higher order functions all the way.
kerkeslager|8 years ago
bitwalker|8 years ago
When you are doing simple maps/filters whatever, then yeah, higher order functions all the way.