Iteration over recursion?
Sudden Disruption
rod at sudden.net
Tue Jun 20 18:40:18 EDT 2006
Nick,
> you will have cursed the concept to hell and back again. Been there - done that :-(
My point exactly. Years ago with Pascal I took the recursive approach
way too often with much distress. I began to learn that if I move
enough stuff out of the loop and set up a context that could easily see
what was getting "re-cursed" (great term), iteration was often much
easier to debug and FAR more effective to execute.
Since those times I can count on one hand the times I've used recursion
- and then only because I was late for lunch and I knew "i" wouldn't
get away from me.
> As someone who was in this area when the Algol versus Fortran wars were
I'll take your word for it. My start with recursion was Pascal.
> Agreed. Recursion should be used when it is the right technology to
> clarify the code, and not as a gimmicky, obfuscatory and often dogmatic
> substitute for iteration!
Well put.
> There are algorithms that become almost incomprehensible without recursion, and I
> have implemented a recursion layer in both assembler AND Fortran just to enable me
> to write them without going bonkers.
With a reasonable exception.
Sudden Disruption
--
Sudden View...
the radical option for editing text
http://www.sudden.net/
http://suddendisruption.blogspot.com
More information about the Python-list
mailing list