standards: Names
1
1 5.4 Naming Variables, Functions, and Files
1 ==========================================
1
1 The names of global variables and functions in a program serve as
1 comments of a sort. So don't choose terse names--instead, look for
1 names that give useful information about the meaning of the variable or
1 function. In a GNU program, names should be English, like other
1 comments.
1
1 Local variable names can be shorter, because they are used only
1 within one context, where (presumably) comments explain their purpose.
1
1 Try to limit your use of abbreviations in symbol names. It is ok to
1 make a few abbreviations, explain what they mean, and then use them
1 frequently, but don't use lots of obscure abbreviations.
1
1 Please use underscores to separate words in a name, so that the Emacs
1 word commands can be useful within them. Stick to lower case; reserve
1 upper case for macros and 'enum' constants, and for name-prefixes that
1 follow a uniform convention.
1
1 For example, you should use names like 'ignore_space_change_flag';
1 don't use names like 'iCantReadThis'.
1
1 Variables that indicate whether command-line options have been
1 specified should be named after the meaning of the option, not after the
1 option-letter. A comment should state both the exact meaning of the
1 option and its letter. For example,
1
1 /* Ignore changes in horizontal whitespace (-b). */
1 int ignore_space_change_flag;
1
1 When you want to define names with constant integer values, use
1 'enum' rather than '#define'. GDB knows about enumeration constants.
1
1 You might want to make sure that none of the file names would
1 conflict if the files were loaded onto an MS-DOS file system which
1 shortens the names. You can use the program 'doschk' to test for this.
1
1 Some GNU programs were designed to limit themselves to file names of
1 14 characters or less, to avoid file name conflicts if they are read
1 into older System V systems. Please preserve this feature in the
1 existing GNU programs that have it, but there is no need to do this in
1 new GNU programs. 'doschk' also reports file names longer than 14
1 characters.
1