Null Function

In computer science, a null function (or null operator) is subroutine that returns no data values and leaves the program state unchanged. When it is part of the instruction set of a processor, it is called a NOP or NOOP (No OPeration).

Mathematically, a (computer) function f is null if and only if its execution leaves the program state s unchanged. That is, a null function is an identity function whose domain and codomain are both the state space S of the program, and for which:

f(s) = s for all elements s in S.

Less rigorous definitions may also be encountered. For example, a function may take a single operand, transform it into a new data type, and return the result. While such usages bear a strong visual resemblance to identity functions, they create or alter a binary data value and thus change the program state. From a software maintainability perspective it is better to identify such "minor" alternations of state explicitly, since calling them null functions provides future maintainers of the code with no insights on their actual purposes.

Read more about Null Function:  Uses

Famous quotes containing the words null and/or function:

    A strong person makes the law and custom null before his own will.
    Ralph Waldo Emerson (1803–1882)

    Uses are always much broader than functions, and usually far less contentious. The word function carries overtones of purpose and propriety, of concern with why something was developed rather than with how it has actually been found useful. The function of automobiles is to transport people and objects, but they are used for a variety of other purposes—as homes, offices, bedrooms, henhouses, jetties, breakwaters, even offensive weapons.
    Frank Smith (b. 1928)