Path: utzoo!mnetor!uunet!mcvax!enea!sommar From: sommar@enea.se (Erland Sommarskog) Newsgroups: comp.software-eng Subject: Re: Question Re: Configuration Management Message-ID: <2765@enea.se> Date: 25 Feb 88 11:55:15 GMT References: <497@aimt.UUCP> <2640@ihlpe.ATT.COM> <1328@wor-mein.UUCP> Reply-To: sommar@enea.UUCP(Erland Sommarskog) Followup-To: comp.software-eng Organization: ENEA DATA AB, Sweden Lines: 40 Pete Turner (pete@wor-mein.UUCP) writes: >In article <2640@ihlpe.ATT.COM> daryl@ihlpe.ATT.COM (Daryl Monge) writes: >>None, unless of course the modules are unrelated. For example, wouldn't >>you want the insert, delete, and search functions for a hash table >>implementation in a single file "hash.c" for readability and maintenance? > >No, personally I wouldn't. I would put the files insert.c, delete.c >and search.c (or HS_insert.c, HS_delete.c and HS_search.c) in the directory >"hash". I just don't see any advantage in putting more than one function >in each file. As this discussion have continued, I'm getting quite convinced that the issue is quite related to the language in use. Some language may support one of the different approaches better than the other. First of all the language must be modular at least in some sense. In standard Pascal you would have to put the whole project in one file :-) I have worked a good deal with EriPascal, which is a Pascal extention by a famous Swedish telephone company with modulariztion and real-time features, reminding of Modula-2. Anyway, EriPascal does not allow variables to be exported, so the hash table must in be one module. In Ada both flavours are available, although I would recommend to have them in all in one file as a package, this is the natural Ada approach. Specifically this is very useful, when constructing a generic unit. Note, however, that Ada permits procedures in a package to be separate, which is the way to go when the procedure gets big. As for C, which have been mentioned most, one procedure - one file may be better, but since I don't know C I don't really have any opinion. Generally I think that modules should be kept small in size, just as they are structured in some way. Typing DIR and getting 120 source files listed is just a night mare. As Pete pointed out: put related files in a directory. -- Erland Sommarskog ENEA Data, Stockholm sommar@enea.UUCP "Souvent pour s'amuser les hommes d'equipages and it's like talking to a stranger" -- H&C.