Nesting In Your Code : Protecting your code from high error rates.

Nesting In Your Code : Protecting your code from high error rates. Image

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.

Chad Jones Photo
Chad Jones Photo
About the Author

Chad Jones

Chad is the Founder and CEO at Push and was a former Apple Engineer before returning to Saskatchewan to help revolutionize the mobile development world. Chad is passionate about creating efficient, well-designed software.