Why You Should Always Use Recursion
Why read this manifesto?
To understand why you should always use recursion, you must first understand why you should always use recursion.
Case 1: The Self-Referential Nature of Understanding
To comprehend why recursion is superior, consider the following:
- To understand complex ideas, we break them into simpler parts
- To understand those simpler parts, we must understand recursion
- To understand recursion, read this manifesto
- GOTO 1
Case 2: The Proof
Let P(n) be the proposition "Recursion is the best solution for problems of size n"
To prove P(n) for all n ≥ 1:
-
Base case: For n = 1, recursion is the best solution because:
- To prove recursion is best for n = 1
- We must use recursion to prove it
- Therefore, recursion is best for n = 1
-
Inductive step: Assume P(k) is true for some k ≥ 1
- To prove P(k + 1), we must:
- Break down the problem of size k + 1
- Into a problem of size k (which we know is best solved with recursion)
- Plus a problem of size 1 (which we proved is best solved with recursion)
- Therefore, P(k + 1) must also be true
- Q.E.D.
Case 3: Real-World Applications
Consider how to convince someone to use recursion:
- Show them this manifesto
- When they ask why they should believe this manifesto, show them this manifesto
- Repeat until stack overflow or enlightenment, whichever comes first
Case 4: Counterarguments
For any argument against recursion:
- If the argument is simple, solve it recursively
- If the argument is complex, break it into smaller arguments
- GOTO 1
Conclusion
You should always use recursion, because:
- To understand why, refer to the introduction
- To understand the introduction, read this conclusion
- To understand this conclusion, you must understand why you should always use recursion
Disclaimer
This manifesto may cause infinite recursion in the readers mind. In case of mental stack overflow, remember: the base case is that recursion is awesome.