syque.com

The Psychology of Quality and More

| Menu | Books | Share | Search | Settings |

C Style: Standards and Guidelines (contents)

CHAPTER 7 : File Layout

PART 3 : LAYOUT

CHAPTER 7 : File Layout
7.1 Layout of directories
7.2 Division of files
7.3 Considerations for File Layout
7.4 Header files
7.5 Layout of Data files
7.6 Layout of Code files
7.7 Summary

<--Prev page | Next page -->

 

7.1  Layout of directories

It is just as important to keep good organization of program files as it is to organize the contents of those files. Look at the contents of the directories of many projects and you will find large numbers (often hundreds) of files in each. Finding a file within this is as difficult as finding a function within a very large source code file. With a little extra care in the definition of the code development environment, files can be made much easier to find.

7.1.1  Directory size

What is the most usable size for a directory? This depends on its usage. Those that are seldom looked at, such as object code directories, can contain any number of files. For those that are often looked at, it is most convenient if all files can be seen on-screen at once. For most systems this is around 24 files (for one file per line). Twice this isn't too bad, but when you get to around 100 files in a directory it becomes very inconvenient when you are looking for a file whose name has temporarily slipped your mind. On the other hand, if files are spread over a large number of directories, and you don't know which directory the file is in, it can be even more inconvenient searching for it, as you must now change directories between listing them (unless, of course, you have a clever enough file search utility).

7.1.2  Division of directories

There are several different types of file associated with a software product, which can be kept in different directories, thus making them easier to organize and use. This includes source code files written by the programmer, object code generated by the compiler, executable programs generated by the linker, libraries supplied with the programming system, data files used by the program and executable programming tools. It is common to split directories along these functional boundaries:

 

e.g.                          system/tools

                               compiler/libraries

                               program/object

                               program/libraries

                               program/executable

                               program/source

------------------------------------------------------

In a large program development, it may be useful to further divide the source code directories, based on program subsystems and functional areas.

 

e.g.                          program/source/area1/subarea1

                               program/source/area1/subarea2

 

There are various other alternatives for organizing source code directories, for example by programmer, particularly on a multi-user system. This will fall naturally into place if each programmer is confined to a specified functional area. The most important thing is that the directory layout is understood, organized and controlled.

Note that the build system (e.g. 'make') and code control system (e.g. 'sccs') must know about, and be able to cope with this directory organization, and that portability issues may have to be considered.

 

<--Prev page | Next page -->

 

Site Menu

| Home | Top | Settings |

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

More Kindle books:

And the big
paperback book


Look inside

 

Please help and share:

 

| Home | Top | Menu |

© Changing Works 2002-2015
Massive Content -- Maximum Speed