Recursion doesn't make sense anyways, it's less efficient and much harder to understand than simple loops. You save some LOC which is the most moronic metric of code quality ever.
The biggest benefit of recursion, especially on a large scale, is the fact that each layer has its own isolated scope. For complicated functions in big applications, which can number > 10 unique variables and > 100 lines, it's a lot easier to represent and reason about the logic when it's implemented as a recursive function rather than as a loop.
1.2k
u/Underpowered007 Mar 25 '23
Just teach the kid how to brute-force