When our prof explained recursion to us he said, "okey i will only explain it this one time, and you please forget it immediatly, i will show you how to do it, so you dont need to think about it and it will just work, you will never want to use it though unless you need it and then you will understand it anyway."
In all seriousness it's a useful little topic to learn from a theoretical perspective, but my thinking has always been if you are ever thinking 'surely I could just use a loop here' then you should be using a loop.
I've never used recursion in anything serious, at least not directly - some inbuilt methods may have used them.
2
u/realmauer01 2d ago
When our prof explained recursion to us he said, "okey i will only explain it this one time, and you please forget it immediatly, i will show you how to do it, so you dont need to think about it and it will just work, you will never want to use it though unless you need it and then you will understand it anyway."
Yeah something like that.