Opentopia Directory Encyclopedia Tools

Can't happen

Encyclopedia : C : CA : CAN : Can't happen


In computer programming, "can't happen" refers to code often inserted by a programmer in order to report if there is a fault in the program and the "can't happen" does happen.

"Assertions" are a variation on this — code that "asserts" that a situation must be true and reports if it is not so. For example, in a medical application a database must never link a treatment to the wrong patient, as this could have serious effects. To be certain that an unforeseen situation will never produce an undetected error, a programmer may separately record the Patient ID on every treatment, and on recalling it check that the treatment has that Patient ID, and if not so then suppress the display of the offending record labelling it as "unrecallable". This is "can't happen" code in one sense, but "shouldn't happen" code in another sense and can be used to ensure very high reliability.

 


From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.

Search Titles
0123456789
ABCDEFGHIJ
KLMNOPQRST
UVWXYZ?

E-mail this article to:

Personal Message: