This is not a case where I can use both without problems, because I'm already convinced that loops are much easier to understand and I try to always use them. But then I stumble upon this (C++ function for binary search tree):
Node* Insert(Node* &rootptr,Node* data) {
if (rootptr == nullptr) {
rootptr = data;
}
else if (data->number <= rootptr->number) {
rootptr->leftptr = Insert(rootptr->leftptr,data);
}
else {
rootptr->rightptr = Insert(rootptr->rightptr,data);
}
return rootptr;
}
And my mind gets blown when I try to think how to make it through loops. Well, why to suffer then? Use recursion if it's the case. But the fact that my mind gets blown actually shows how harmful recursion is, because when you look at it you don't understand what it exactly does. Yes, it's neat, but it's a dangerous kind of neat, when it does several things at the same time and you don't really comprehend what is happening.
So in my opinion there are 3 cases: when recursion is simple and there's no reason to cope with it, when recursion is complex and you make your code unreadable, and of course some cases when there's no other way, so you just have to use it, like with Ackermann function. Why to use it then (besides some specific cases)?