2 ms·
I wish I had had this years ago. I one time wrote this fairly elaborate SQL generation thing that required pretty liberal use of recursion in order to fulfill
by tombert 2y ago
I wish I had had this years ago.
I one time wrote this fairly elaborate SQL generation thing that required pretty liberal use of recursion in order to fulfill all the requirements. It ended up being a lot of mutual recursion and the code was admittedly kind of messy but it was a necessary evil to do everything asked of me.
A more senior engineer ended up taking over the codebase, "fixed" all my code to be this iterative thing, made a point to try and lecture me about why recursion is bad in an email, only for his code to not actually do everything required and him reinventing effectively everything I did with recursion.
In fairness, he did actually apologize to me for some of the comments he made, but if I had thought about putting this comment on the top maybe we could have avoided the whole thing.
- bccdee 2y agoI've never heard anyone say recursion is bad. What a weird view. It's a problem if you're overflowing the stack, of course, but otherwise…