Why are so many people deathly afraid of recursion? check out the first repy to my post in threads forum http://www.javaranch.com/ubb/Forum27/HTML/000317.html no disrespect intended but its no more "dangerous" than while(true) and I will use either if thats what works best
i love recursion! once i got the hang of it a few semesters ago in a c++ class i have used it whenever possible. however, before i figured it out, i stayed away. a wise man once said: "we fear that which we do not understand." i used recursion in my last program for the cattle drive. marilyn's pick was that recursion is cool, but later down the road someone modifying your code might not understand what is going on. i can understand that, and i suppose the while( true ) statement i replaced it with is more "in your face". however, she also hinted that the loop was better in that situation because it would only be called 3 times... if the method needs to be called numerous times, i would think recursion would be better... correct me if i am wrong.
Squanch that. And squanch this tiny ad:
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps