next up previous contents index
Next: 5.3.4 Variable names Up: 5.3 Naming conventions Previous: 5.3.2 Program names   Contents   Index

5.3.3 Names of modules, subroutines, and functions

Module names should end in _module. They should have at least one and at most two underscores indicating the module group name and subgroup name like group_module or group_subgroup_module.

Contained routines are then named group_DoThis or group_subgroup_DoThat or group_subgroup_SomeOperation. Routine names should contain at least one, at most three underscores. Thus, the name should indicate the module the routine belongs to. Short names like Init or Output should not be used to avoid name-space pollution and be called group_Init or group_subgroup_Output, instead. Ideally, all routines should have a globally uniq name even if that not strictly necessary because modules are never used together or some subroutines are kept private in the modules. The use of CamelCase for the subroutine name is encouraged.

If unit-test routines for a group_module or group_subgroup_module are collected in a separate module this should be called groupUT_module or group_subgroupUT_module, respectively.