Thread: Recursion?
View Single Post
  #13   Spotlight this post!  
Unread 13-12-2003, 18:57
Mercutio Mercutio is offline
Atticus Finch Wannabe
#1213 (The Grobots)
 
Join Date: Feb 2003
Location: Birmingham, Michigan
Posts: 63
Mercutio is on a distinguished road
Re: Recursion is evil

Quote:
Originally Posted by Rickertsen2
Recursion is a bad pracice on any platform and should be avoided.
I totally disagree. When you have the resources, recursion is an invaluable tool. It's the heart of Deep Blue's chess game, Google's page ranking system, and the fastest sorting algorithm ever written. Although looping is usually more efficient, recursion is much simpler, and once you figure out how to do something recursively it's often very easy to write a loop that does the same thing.

That said, using recursion or looping in your FIRST code is probably a bad idea. Aside from recursion's stack problems, both methods can eat up a lot of time if you're not careful, which would slow down your robot's reflexes. Also, I can't see what you'd need it for! Most of what your robot does is reacting to stuff, not calculating.

~~Aaron

[edit]Oops, I just saw Dan's post where he says the same thing. Go Dan! Way to steal my thunder... [/edit]
__________________
"If we knew what we were doing, it wouldn't be called research, would it?"
—Albert Einstein

<X3 What can I do? You broke the tie wraps that were holding together my heart. ^_^

Last edited by Mercutio : 13-12-2003 at 19:01.