Recursion: Leave it or Deal with the Negative Consequences
Recursion: Leave it or Deal with the Negative Consequences Jeferson L. R. Souza thejefecomp@neartword.com December 31, 2023 Abstract The moment we acquire knowledge of computer programming—mainly at a professional level—recursion is a technique we definitely avoid to use while either designing or implementing solutions for real-world problems. Although recursion has a great link with Math and a tight relation with heuristics related to Artificial Intelligence (AI), helping defining and understanding a problem in an easy way, the negative consequences of its use may become a nightmare during the execution of an algorithm written with any programming language. In order to avoid the use of recursion, even if we rely on compiler-tools optimisations such as Tail Call Elimination, we should always design an iterative solution from scratch if performance is an intended goal. In this paper-like post, we discuss what recursion is, visiting its drawbacks to understand why we must choose an i