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
-
Eariel19088yI used them quite a bit on game development; on apps usually the stuff that need them is already implemented on libraries.
-
Had to use them once or twice, when implementing unlimited nesting of groups in a communication environment
-
Use them all the time in personal projects.
Don't use them at work as everything is safety critical and they are banned. -
nocgod17588yI used recursion last week to write an algorithm to normalize JSON flat keys or mixed keys to hierarchical key schema.
-
Adamu178yI get your pain although recursion can be the prettiest way to solve something. Unfortunately, I find the really pretty examples are the ones most likely to blow your stack.
e.g. Tail recursion is the only kind where in some languages you categorically don't need to worry about this problem because the optimizer will rewrite so that it's not actually recursion. Of course, these are the ones you could rewrite yourself to not recursion so you don't blow your own personal internal callstack.
The nice uses that save many lines of code are like where each call of the function spawns another 4 of itself going off in different directions. Cute but that callstack is in for pain. -
@RubyTuesday - Not true always. Recursion is way more inefficient than iterative loops, especially for larger numbers as recursive algorithms have to store each return value in memory and pass them back to the parent function.
-
Esper938yI use a lot of recursive tree traversals for my current project. If you do functional programming you automatically use more recursion than loops, as well.
-
I am writing a recursive decent parser that needs recursion
And the language has infinite recursion? Not just in tail call position
Related Rants
-
nikmanG16CS Professor: “What M word is the black hole to all productivity?” Student: “Management” CS Professo...
-
castor-rg25!Rant I GRADUATED FROM COLLEGE TODAY WITH MY DEGREE IN COMPUTER SCIENCE! Now to find a job :D
-
snackOverflow21My JavaScript professor once thought my work was "too good" and decided to pull me aside, in front of the clas...
Fucking recursive algorithms. Does anyone actually use them when programming in real life?
undefined
college