Strict programming paradigm allows the programmer to define only strict functions.
A strict function is a function whose parameters must be evaluated completely before the function call. In formal notation, a strict function is a function F for which
F(undefined) = undefined.
undefined denotes an expression which has no specific value, either because it has not been evaluated yet or because its evaluation has ended in an error.
Functions with several parameters can be strict or non-strict in each parameter, as well as jointly strict in several parameters. To be strict in one parameter, the function has to return
undefined when this parameter is
undefined, regardless of values of the rest of parameters. If the function is strict in at least one parameter, it is jointly strict in all its parameters. An example of a function which is strict in each parameter is addition:
undefined + number = number + undefined = undefined.
Strict programming is the opposite of non-strict programming.
- C# (dialects: Cω, Polyphonic C#)
- C++ (dialects: C++03, C++98)