Too Long; Didn't Read
One of the most fundamental tools in programming is a loop. While there are many different types of loops, almost each type of loop has the same basic function: iterating over data to analyze or manipulate it. Recursion is another popular type of function and although it can also analyze and manipulate sequences of data similar to a loop, recursion is probably less understood in many cases, and can often be somewhat confusing. Almost all recursive functions can be re-written as loops, and vice versa. However, each type of function has advantages and disadvantages, and knowing when to use one over the other is something we’ll take a look at here. In the following post, we’re going to try and answer the following questions: