Mutual recursion: Difference between revisions

Content deleted Content added
Prevalence: Added Blockquote
Tags: Mobile edit Mobile web edit Advanced mobile edit
Line 98:
 
Some programming styles discourage mutual recursion, claiming that it can be confusing to distinguish the conditions which will return an answer from the conditions that would allow the code to run forever without producing an answer. [[Peter Norvig]] points to a [[design pattern]] which discourages the use entirely, stating:<ref>[http://norvig.com/sudoku.html Solving Every Sudoku Puzzle]</ref>
{{quoteBlockquote|text=If you have two mutually-recursive functions that both alter the state of an object, try to move almost all the functionality into just one of the functions. Otherwise you will probably end up duplicating code.}}
 
==Terminology==