If recursive programming is necessary, be aware of the demands on the stack. Try to minimize the size of the parameters being passed down, and try to move local automatic variables out of the recursive part of the function. If at all possible, build in a recursion depth limit to prevent the stack overflowing.