Comment on Curious C++ Lambda Examples: Recursion, constexpr, Containers C++23 includedparentComments−mxz30004yIn production code, you'd generally avoid recursion to avoid stack overflows.Given in most languages you can't enforce tail call optimisation, it's risky to use unbounded recursion.−CoastalCoder4yI suspect this guideline varies a lot by industry or by target hardware.The last time I worked on a project with that rule was about 23 years ago, and that was on a 32-bit system.
Comments
In production code, you'd generally avoid recursion to avoid stack overflows.
Given in most languages you can't enforce tail call optimisation, it's risky to use unbounded recursion.
I suspect this guideline varies a lot by industry or by target hardware.
The last time I worked on a project with that rule was about 23 years ago, and that was on a 32-bit system.