Jump to content

Run-time checking: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Sharpen category.
bad link repair. You can help! using AWB
Line 1: Line 1:
'''''Runtime checking''''' is a mechanism of a [[programming language]] to check for errors at runtime, e.g. [[Arithmetic overflow|arithmetic overflows]] or invalid [[Cast (computer science)|type casts]]. Most times an [[exception handling|exception]] is thrown and/or the program is terminated, instead of ignoring this failure as it is done in [[C programming language|C]], [[C++]] etc.
'''''Runtime checking''''' is a mechanism of a [[programming language]] to check for errors at runtime, e.g. [[arithmetic overflow]]s or invalid [[Cast (computer science)|type casts]]. Most times an [[exception handling|exception]] is thrown and/or the program is terminated, instead of ignoring this failure as it is done in [[C programming language|C]], [[C++]] etc.


'''''Runtime checking''''' is often criticized for slowing down the resulting program. However this ignores the fact that most compilers for languages with '''''runtime checking''''' allow one to switch the checks off when performance is more important.
'''''Runtime checking''''' is often criticized for slowing down the resulting program. However this ignores the fact that most compilers for languages with '''''runtime checking''''' allow one to switch the checks off when performance is more important.

Revision as of 23:28, 16 June 2006

Runtime checking is a mechanism of a programming language to check for errors at runtime, e.g. arithmetic overflows or invalid type casts. Most times an exception is thrown and/or the program is terminated, instead of ignoring this failure as it is done in C, C++ etc.

Runtime checking is often criticized for slowing down the resulting program. However this ignores the fact that most compilers for languages with runtime checking allow one to switch the checks off when performance is more important.

While on the other hand, adding runtime checking to a language that does not support it normally is close to impossible, since those languages don't have the needed language constructs.

Runtime checks can be very beneficial. In the case of Ariane 5 Flight 501, the lack of runtime checks caused a critical computer error costing the ESA €885,000,000.

See wikibooks:Programming:Ada:Types:range as an example on how runtime checking can be defined in the Ada programming language.