Arch Angel
Aug 23, 2017 · 1 min read

Good article — but since this is intended for those unfamiliar with the concept, it could perhaps be more emphasized that while recursion is a useful pattern for specific restricted cases, it is not the ultimate go to solution just because the code is somewhat less complicated than a loop.

The factorial example is a good case. It certainly does the job, but is up to an order of magnitude slower than the loop and is potentially impractical to use for a large number (e.g., you might blow the call stack calculating 1B!)

)

    Arch Angel

    Written by