Re:The ancient world before computers had stacks or heaps
by Joel_Mckay on Wednesday April 03, 2024 @06:38PM
(#39924216)
For many reasons, people often add nesting limits in recursive structures to at least constrain how bad they behave when something eventually does go wrong.
Parsers are far from immune to these issues.
I think we will have to "agree to disagree" here... =)
There may be use cases where it's insecure or has performance concerns, but those are the exception. Most of the time, it's fine.
We don't generally tell programmers that loops are naive, often dangerous, and risk locking up the program. They certainly can, but most just... don't.
Just like loops, recursion can make code much simpler to write, read, and maintain. Every modern language under the sun supports it for very good reasons. Use it.