The Psychology of Quality and More |
CHAPTER 5 : Naming
5.11 Naming Files and DirectoriesFiles, and the directories that hold those files can use a similar naming convention to variables to describe the functions or files that they contain. They are often more constrained in length than C identifiers, consequently requiring the more severe use of abbreviations. 5.11.1 Naming filesFiles are can often be named using a functional grouping prefix, reflecting the subsystem they belong to and the action of the functions that they contain:
winopn, winmov, kbdread, kbdinit
Using the same or similar names to system files (such as stdie.h) should be avoided. SuffixesIt is common to use a suffix (or 'extension') to describe the type of file - indeed, it is expected by some compilers. The basic subset is '.c' for C source files and '.h' for an included header file. All suffixes should be documented, including reserved system suffixes, such as '.o' for object files, '.y' for 'yacc' files, etc. For maximum portability, file names should start with an alphabetic character, be alphanumeric, have 8 characters or less in the main name, with no more that three characters in the suffix. 5.11.2 Naming directoriesDirectory structures are like nested C 'struct's, and can be named in a similar manner.
/windows/source/iconize/
In this scheme, 'windows' contains all files for the windowing system, 'source' contains all source files, and 'iconize' contains source files for the iconizing functions.
|
Site Menu |
Quality: | Quality Toolbook | Tools of the Trade | Improvement Encyclopedia | Quality Articles | Being Creative | Being Persuasive | |
And: | C Style (Book) | Stories | Articles | Bookstore | My Photos | About | Contact | |
Settings: | Computer layout | Mobile layout | Small font | Medium font | Large font | Translate | |
You can buy books here |
And the big |