QUOTE(noahbody @ Jan 5 2011, 20:31)

AND AGAIN I CANNOT STRESS THIS ENOUGH: If you're not using Trees (Binary, B, B+, etc), DO NOT FUCKING USE RECURSION. There are very few instances outside of trees where a recursion can't be solved with whiles/fors/loops. Sometimes it's going to look ugly, but if you're writing code, you're doing it to be functional, not pretty. Pretty is secondary.
Actually, if the thing doesn't have to be lightning fast (like for example in the UI code), and the code has a high chance of having to be modified by not-too-bright programmers I work with, I often end up doing recursion exactly so it doesn't look ugly, because if it does, I'll have to go back to it every time another programmer breaks something.