From: Mel (mel at domain csn.ul.ie)
Date: Fri 29 Oct 1999 - 09:14:33 IST
On Thu, 28 Oct 1999, Caolan McNamara wrote:
> On 28-Oct-99 John P . Looney wrote:
> Reminds me of the horrors of using recursion in the real world. I
> remember on co-op some moronic computer science character had
> decided to write some bastardized linked list adder using recursion,
> sure it works fine on those imaginary computers, but in the real world
> embedded dos system that it went into it just *ATE* stack space, and
> when adding something like the 300th entry if ran out of stackspace and
> just barfed and died. A complete nightmare to find, coz theres nothing wrong
> in the way of syntax, and with simple short test all would work fine, it
> would only happen during a very long test, overnight in this case.
> Luckily the idiot who had written it had left the company just a week
> or so before I found this obscenity hidden away in the bowels of the
> system. Never liked recursion after that. If theres any feasable non
> recursion way of doing it, do that instead. Or stick a big static variable
> into the middle of it and limit the depth of it to some known value, gagh!
I'd say thats because Computer Scientists often spout about the merits of
recursion and rarely consider what happens on the real machine in terms of
stack space and function call overhead. It means many algorithms that
could be solved through iteration are solved with recursion because it
looks cooler or on an ideal machine with infinite memory and no function
overhead and/or would be smaller. Computer Science is too theoritical for
it's own good and that poor chap was one result of it.
It's all great and grand doing a course that concentrates on programming
theory but the silly thing should concentrate a bit on programming itself
a bit more.
Mel (Doing computer science degree)
This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:04:48 GMT