|
|
|
|
|
by GnarfGnarf
464 days ago
|
|
I write a genealogy app (family history). Recursion is the foundation of the code, and permeates everywhere. The call stack can go 200 deep or more (~4,000 yrs). The code has been successfully running on millions of desktops for thirty years, and has never caused a crash or infinite loop because of recursion. The secret is to check at every step that there is no "he's his own grandpa" loops in the user's tree, where (s)he inadvertently makes one of a person's descendants, also his ancestor. This happens sometimes because re-using the same names can cause confusion. Recursion is like magic :o) |
|