Path: utzoo!attcan!uunet!wuarchive!udel!new From: new@udel.EDU Newsgroups: comp.lang.misc Subject: Header files Message-ID: <24955@louie.udel.EDU> Date: 27 Sep 89 18:36:44 GMT Sender: usenet@udel.EDU Reply-To: new@udel.EDU (Darren New) Organization: University of Delaware Lines: 30 One thing I have always liked about the C language was the separation between the "header" files (.h) and the "code" files (.c). In other languages, such as Modula-II and (I think) Ada, it is not possible to define multiple "implementation" modules for a single "definition" module. Note that I mean multiple implementation modules implementing different parts of the same header module; I do not mean different complete implementations of the same header module. For example, in C I can make one header file that defines the prototype information for all the string functions. I can then write each string function into a different implementation file. Thus, with one "include" (Import) statement, I get all the declarations for all the string functions. However, the linker only links in the functions I use. As another example, all the file stuff is in "stdio.h". However, it can be implemented with open, read, write, close, and delete in five different code files, allowing me to avoid loading the writing code if I don't write, allowing me to link the open/close in one overlay and the read/write in another overlay, and allowing me to avoid recompiling the entire I/O library when making a change to just one routine. I know of no other compiled language defined in this way (except, of couse, C++). This would be less of an issue if linkers or compilers were smart enough to only include the functions from a single module that were actually used and if we all had demand-paged VM. Even this, however, would not solve the "recompile everything" problem. I know very little Ada, but it seems to me that I've not heard of this ability in Ada. Does anyone know of any relatively popular languages that allow this sort of separation other than C and C++? If not, why not? Discussion? -- Darren