loading...

Answer: What is recursion and when should I use it?

harittweets profile image Harit Himanshu ・1 min read

There are a number of good explanations of recursion in this thread, this answer is about why you shouldn't use it in most languages.* In the majority of major imperative language implementations (i.e. every major implementation of C, C++, Basic, Python, Ruby,Java, and C#) iteration is vastly preferable to recursion.

Discussion

pic
Editor guide