Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Switches, default, and enums
#7
I agree completely with George, an important purpose of the rule is defensive programming against \"RAM noise\", ie in a safety-critical system the RAM can't be trusted to keep its values during long periods of time. Also, if there is an undetected runtime bug altering a memory location unexpectedly, the bug can be detected, and damage caused by it avoided, if using this method.

The same argument can be used for justifying rule 14.10 saying that you must end an \"if...else if\" with \"else\".


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)