One of the famous mistakes I come across from time to time while performing code reviews is the excessive uncalled-for usages of Recursion.
I can hear someone asking now: What is wrong with Recursion?!!
My answer is: Recursion is not always bad if you know when and how to use it. Sometimes there is some better alternatives which you could be missing.
The main concern about using recursion is that it is too expensive in terms of memory consumption. That’s why you need to be cautious about using it.
You don’t believe me, right? Let me show you an example.
If you are interested into reading more about this topic, you can read the rest of the article.
▶ Subscribe to Medium using my referral link
▶ Subscribe to Medium Newsletter
▶ Subscribe to LinkedIn Newsletter
▶ Follow me on Medium
▶ Follow me on Twitter
▶ Follow me on LinkedIn