|Home > Iris APIs > Naming conventions|
This topic describes the naming conventions that the Iris interface uses.
Table 4-1 Naming conventions for Iris functions, objects, and events
|Function argument name||lowerCamelCase||
|Object member name||lowerCamelCase||
|Object type name||UpperCamelCase||
|Event field name||UPPERCASE_WITH_UNDERSCORES||
Acronyms are treated like normal words and are written in lowercase, but sometimes have an uppercase first letter, for example
Function names are hierarchical, with hierarchy levels separated by
an underscore. All functions have at least two parts, namely the group or interface
name, and the function name, for example
resource_read. Function names might have more hierarchy levels to
group the functionality further.
See also 4.18.9 Naming conventions for new functions for the naming conventions to use when enhancing the interface.
Experimental functions are prefixed by
experimental_ to avoid
namespace pollution. Experimental functions are not part of the official Iris
interface. Their semantics, arguments, and return values can change without notice.
Experimental functions might become part of the Iris interface, and then lose the
prefix, or might be removed without replacement.
Custom functions are prefixed by
custom_ to avoid name clashes when multiple companies extend the Iris interface with their own functions. Introducing custom functions must be avoided if possible. It is preferable to use a combination of registers, memory spaces, tables, and event sources instead.
Function argument names should be short, if possible less than 24 bytes long, so that function implementations can compare argument names with one or three
uint64_t compares. Details about an argument can be put into a description string which is retrieved using
instance_getFunctionInfo(), rather than in its name. However it is useful to indicate the units, for example bits, bytes, elements, or milliseconds, in the argument name if multiple interpretations are possible. For example,
Object member names, for example in return values or in complex arguments, should be less than 24 bytes long.