Today I want to talk about levels of nesting. Levels of nesting is a language independent idea. Additionally it doesn’t matter if this is an if statement or a while statement. The If or while statement for example is one level of nesting. Once you’re at the three levels of nesting, you don’t ever want to go to four and above. That is because it is scientifically proven that error rates in code skyrocket. Often exponentially. So instead what you want to do is take whatever code you would have put in there. You would put it into a new routine that your function you would call, and then you would put the same code you would have put that further down in your nesting into the new function.