Jerry Yoakum's thoughts on software engineering and architecture from experience working with code, computer science, python, java, APIs, NASA, data mining, math, etc.
Monday, April 29, 2019
Don't Nest Too Deep
Nesting IF-THEN-ELSE statements greatly simplifies programming logic. On the other hand, nesting them more than, say, three levels deep decreases their understandability considerably. The human mind is capable of remembering only a certain amount of logic before it becomes confused. A variety of simple techniques can be used to reduce nesting.
Reference:
McConnell, S., Code Complete, Redmond, WA: Microsoft Press, 1993.