Directly under the list of rules is the following statement:
Never be a slave to the rules in real life. For training purposes you need to follow these rules to make your mind strong, but in real life sometimes these rules are just stupid. If you think a rule is stupid, try not using it.
It looks like the rules are setup to be overly cautious because the target audience is just starting. By doing this, it forces the student to form good habits when writing future code. If you are able to explain why you no longer think the rule is worth following (and support it with a good reason), you are already thinking deeply on the issue. This means you have weighed the options and decided to accept what risk there might be. You are also less likely to make a mistake the rule would have prevented if you have spent that much time thinking about the rule.
else
to make the end of the condition block more obvious, even if theelse
does nothing. I've never heard such a recommendation for other languages, and to say you must do it seems very excessive. – FrustratedWithFormsDesigner Mar 22 '12 at 20:17else
doesn't make any sense, and not everyif
needs to do something useful in theelse
branch. Anelse
that should never be reached is suspicious in the first place, because why would I write anif
when I'm sure that it will always be true? Maybe there a special reasons that only apply to python, though. – user281377 Mar 22 '12 at 20:18