← Back to context

Comment by spapas82

10 hours ago

For tco to be really useful you need to think in a non procedural way. Imagine that you don't have loops in your language so you need recursion to do stuff multiple times.

Also even in procedural languages there are some problems that are easier to understand and model if you use recursion, for example tree or graph like structures.

traversing graph or a tree is not a TCO case because it would involve a stack/queue for DFS/BFS, whatever. I dont want to think in non procedural way, I reserve this nonsense to haskellers, please provide me a valid python use case for TCO :)