I am learning Scala, but in most of the discussions, people pointing out that "Scala is bad for functional programming since it cannot handle tail calls, tail call is the backbone of Functional Programming".
Is that true?
I am learning Scala, but in most of the discussions, people pointing out that "Scala is bad for functional programming since it cannot handle tail calls, tail call is the backbone of Functional Programming".
Is that true?
This is incorrect. Scala is able to handle tail calls.
You can even annotate functions with scala.annotation.tailrec
. In this case the compiler will throw an error if the function is not tail-recursive. This way you can ensure, that the optimization really is applied.