~ Office Supplies ~~ Buy Posters ~~ A-Z Products ~~ Website Advertising


Assert - Wikipedia

<<Up     Contents

Assert

Redirected from Assertion

In computer programming, an assert is a function or similar programming language construct which immediately aborts program execution if a certain condition or expression is false (an assertion failure). In practice, it is used by programmers during development to check for potential errors or bugs; to aid in this the assert function of most languages may give information such as the filename and line number of the original source code. The functionality is called assertion.

For example, following the dynamic allocation of memory in a programming language such as C, a pointer may be checked to ensure that it is not null before proceeding. Without such an assertion, a reference may occur later that would cause an error.

Asserts are also sometimes placed at points the execution is not supported to reach. For example, they are placed at the default clause of the switch statement in languages such as C, C++, and Java.

Typically, all calls to assert are removed from production code since often using assert calls is considered bad programming practice. The function is primarily of interest to developers during the debugging process. That practice is often criticized using an analogy that it is like practicing swimming in a pool with a lifeguard and then going swimming in the sea without a lifeguard.

Java has supported asserts as a built-in functionality of the language since the release of version 1.4. In languages such as Java that also have built-in support for other types of exception handling, there is no reason to include asserts in production code. For this reason, Java's asserts explicitly support removal at compile time.

Compare with:

wikipedia.org dumped 2003-03-17 with terodump




 
 
40 ct mint green HIDDENITE Faceting cabbing rough raw uncut gemstone crystal nice jewel Beautiful 4
 40 ct mint green HIDDENITE ing cabbing raw uncut crystal nice jewel Beautiful 4 
 
5 grams purple AMETHYST Quartz cabbing tumbled polished rough jewelry gemstones 21 carat PRETTY Nice
 5 grams purple AMETHYST Quartz cabbing tumbled polished jewelry 21 carat PRETTY Nice 
 
Light green butter new jade Serpentine gem stone polished faceted Briolette stringing bead single
 Light green butter new jade Serpentine polished ed Briolette stringing bead single 
 
20 carats metallic silver gray HEMATITE gem stone rectangle magnetic cab rough gemstone 4 grams nice
 20 carats metallic silver gray HEMATITE rectangle magnetic cab 4 grams nice 
 
Tanzanite blue IOLITE gems jewels Loose natural 4mm square faceted cut jewelry gemstone pair 4 mm pr
 Tanzanite blue IOLITE jewels Loose 4mm square ed cut jewelry pair 4 mm pr