Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
If the language uses tail calls then ill use recursion, otherwise I'd be worried about stack overflows
-
neriald14526yI always prefer iterative over recursion. However, it is about 5 times longer code and looks messy.
-
As @neriald said, iterating is always preferred for me for many many reasons, but static is the better of the two imo
-
KAS893706yExcellent answers ya'll. I prefer iteration as well. I do C# and static recursion is expensive. It holds the call stack and all. Simple while true is more than enough.
Static Recursion or While True?
question