In one of my first code reviews (a while back), I was told that it’s good practice to include a default clause in all switch statements. I recently remembered this advice but can’t remember what the justification was. It sounds fairly odd to me now.
-
Is there a sensible reason for always including a default statement?
-
Is this language dependent? I don’t remember what language I was using at the time – maybe this applies to some languages and not to others?