3 ms·
Or you can worry about performance. Or memory usage. Or blowing the stack. Or... There's no free lunch.
by erichocean 15y ago
Or you can worry about performance. Or memory usage. Or blowing the stack. Or...
There's no free lunch.
- tikhonj 15y agoYou still have to worry about performance and memory usage with a for loop. You don't have to worry about blowing the stack, but you wouldn't have to worry about that in a language with proper tail call support either. Admittedly, you do have to worry about the stack in Haskell, but that is entirely the fault of laziness and not recursion or higher-order functions. You're not really worried about a call stack, you're worried about having a really big thunk (deferred expression). There may be no free lunch, but some are much better value for money than others.