The Art of Computer Programming is a book by Donald Knuth. In it, Knuth explains how to avoid using else statements in your code. Else statements break the line-of-sight rule, and they always lack context. Here, we show how to remove else statements from your code in two ways.

6m read timeFrom dglsparsons.hashnode.dev
Post cover image
Table of contents
Line of Sight rule #Lack of Context #How to remove else statements? #Inverting the condition #
4 Comments

Sort: