Recursion may have been useful back in the old days when memory mattered but that’s no longer the case (unforunately). Anyone using it, in my experience, was showing off or stroking their ego. Change my mind.
-SB
>>Anyone using it, in my experience, was showing off or stroking their ego.
There’s an old computer joke about what people were given to eat while designing languages. COBOL was hamburgers. APL was bread and water. Lisp was tea.
I knew many who adored it, and not for ego. Most people I knew “spoke” tens of languages. Once you got the 2nd one under your belt, the rest just fell out. They loved it for the pared down beauty of the language. They saw it as art.
My husband was one of the most passionate users of the language in the old days.
I never met McCarthy.
I picked up a patent in Electronic Warfare because I figured out that recursion with variable swap was the way to computationally solve a problem in antenna design. The government owns it but my name is on it.
WWG1WGA
Garde la Foi, mes amis! Nous nous sommes les sauveurs de la République! Maintenant et Toujours!
(Keep the Faith, my friends! We are the saviors of the Republic! Now and Forever!)
LonePalm, le Républicain du verre cassé (The Broken Glass Republican)
You have to be joking. In the old days, recursion would often use more memory than a conventional iterative solution, because of growth of stack. Tail recursion, a more efficient form invented in the 1980s, has the same memory footprint as iteration.
Now that memory and processing are almost infinite, the key bottleneck is the ability of a programmer to understand a program. Recursion can often make programs shorter and simpler.