Advertisement

My head is spinning

Started by August 22, 2002 09:25 AM
10 comments, last by SteveBe 22 years, 4 months ago
but the point is that recursive function SHOULD be easier to debug ... LOGICALLY ... and with a debugger, for 2 reasons ...

the only differences between writting a function recursively and using an stack and iterative methods (especially with MULTIPLE recursive functions) are: to break the algorithm up into its human understandable, seperately definable and debugable components / states, and to get the benifit of using a debugger''s built in stack viewing ability. If you wrote the same recursive decent parser using a stack and iterative functions, then you would likely have one more complicated piece (the central glue function) and you would have to write special debugging functions to view the contents of the stack and local varaibles at vavrious points of execution ... whereas ... at least in BeOS, using the visual debugger makes tracing ANY execution (even multithreaded, and recursive) as easy as examining the variables at each level of the stack.

But that''s just my preference really ... because I like to think of things as generic peices of functionality, that do there job, given any set of input ... and not think so much about the way they are glued together ...
quote: Original post by Martee
Recursion: See Recursion

(sorry ...)


lol


WyrmSlayer RPG - In Early Development

This topic is closed to new replies.

Advertisement