3 ms·
> I don't care if you are using JS or ASM, learn how to avoid using it. It's a bad idea for a class of languages. Functional languages implementing TCO are a d
by mercurial 12y ago
> I don't care if you are using JS or ASM, learn how to avoid using it.
It's a bad idea for a class of languages. Functional languages implementing TCO are a different kettle of fish (especially if your function is tail-recursive). It's an extremely common pattern in these languages.
- zamalek 12y agoIndeed, however, understanding why it's a bad idea in imperative languages is important when using functional languages. You have to know how what qualifies a function as tail-recursive (and why that is important). You'll only learn that from experience with both classes of languages and most importantly, getting burned due to abusing the stack. I'd rather people learn from the other direction, you know? I'm not sure how that would be implemented, but I see recursion abuse far too often and few seem to understand how that could be a bad thing.