Re:Reconsidering the way I explain programming (2020)
by siraben on Tuesday July 27, 2021 @11:54PM
(#27980106)
This isn't true if your language does tail-call optimization[0].
> I consider it to be a security risk.
Again, non-issue if your language handles recursion properly (and in some languages like Haskell, "blowing the stack" is not a thing that happens).
[0] https://en.wikipedia.org/wiki/Tail_call#Implementation_metho...
Re:Reconsidering the way I explain programming (2020)
by nights192 on Wednesday July 28, 2021 @12:41AM
(#27980309)
I believe he's more concerned about issues where tail-calls aren't possible or attractive.
Re:Reconsidering the way I explain programming (2020)
by macintux on Tuesday July 27, 2021 @11:00PM
(#27979853)
It depends on the language. Many good languages are designed to handle recursion safely.
For some, it’s practically the only way to loop.
Re:Reconsidering the way I explain programming (2020)
by waynesonfire on Tuesday July 27, 2021 @11:59PM
(#27980125)
Looks like you learned something new. You now also have a guage to measure the sophistication of a programming language. Ask if it supports tail call optimization and move on if the answer is no.
Personally I think it should not be used for implementation, I consider it to be a security risk. It's ok for high-level pseudocode.