Grant Edwards <grant.b.edwa...@gmail.com> writes:

> On 2020-12-18, Joe Pfeiffer <pfeif...@cs.nmsu.edu> wrote:
>
>> Recursion has very limited application, but where it's the right
>> tool it's invaluable (top-down parsers, some graph algorithms...).
>> We teach it primarily because by the time a student has a good
>> handle on how to write a recursive function they understand
>> functions in general really well.
>
> Yep, there are definitly cases where it's pretty much the only right
> answer. If you try to avoid it, you end up writing what turns into a
> simulation of recursion -- and doing that correctly isn't easy.

Decades ago I had to write a binary tree search in FORTRAN IV.  It
wasn't pretty.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to