- Each data structure foo should be in its own source code file, foo.clu
- Each set of related subroutines should have their own file, bar.clu
- Equates which are visible outside of a subroutine or a particular data structure in the file baz.clu should be separated out and placed into baz.equ
In general, if only the implementation and not the interface of a module changes, we would not like to recompile other modules that depend upon that module. Noting that the interface for a module is determined by its library file, we will accomplish this goal as follows:
- Each source file, foo.clu, shall have an associated source file foo.lib.clu
- this file will contain only the external data structure and procedure declarations from foo.clu; the procedure bodies in foo.lib.clu will be empty
- it need only be modified when the interfaces/specifications to foo.clu are modified, not when just the implementation is changed
- an awk script has been written to automatically extract foo.lib.clu from foo.clu
- Using foo.lib.clu, a library file foo.lib will be generated
- Modules that depend upon foo will be compiled using foo.lib
Whenever you have multiple people working with interrelated source code modules, and especially whenever they are modifying the same files, you have to be careful that one person's modifications do not have unintentional side-effects for another person. To accomplish this, we will adopt the following conventions.
- Once working source code is placed in the shared code directory, it will only be replaced with revised versions which are also functional.
- i.e. when you are working on/editing a source code file, you will always edit a copy so that the shared code remains functional at all times
- in this way, it should be possible for multiple people to work on the program at the same time with minimal interference
- When a shared code file foo.clu is modified, the previous version will be renamed foo.clu.bak.1 and left in the directory
- in this way, revisions can be easily undone or at least examined, and we will always have a copy of the code which we know works
- after everyone has had a chance to make sure that their code works with the revisions, the backup file may be deleted
- if subsequent revisions are made before the first backup is deleted, the second version should be backed up as foo.clu.bak.2, and so on
- When changes are made to program specifications, the affected people should be notified via email ASAP.