What is the benefit of terminating if … else if constructs with an else clause?
As mentioned in another answer, this is from the MISRA-C coding guidelines. The purpose is defensive programming, a concept which is often used in mission-critical programming. That is, every if – else if must end with an else, and every switch must end with a default. There are two reasons for this: Self-documenting code. If … Read more