Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!csn!ccncsu!purdue!news.cs.indiana.edu!know!sdd.hp.com!cs.utexas.edu!uunet!bria!mike From: mike@bria.UUCP (Michael Stefanik) Newsgroups: comp.lang.c Subject: Re: A question on C programming style Message-ID: <189@bria.UUCP> Date: 14 Apr 91 20:10:48 GMT References: <1991Apr12.103621.8907@umiami.ir.miami.edu> <1991Apr13.144026.5969@cc.helsinki.fi> Reply-To: uunet!bria!mike Organization: MGI Group International, Los Angeles, CA Lines: 26 In an article, wirzenius@cc.helsinki.fi (Lars Wirzenius) writes: |I very much prefer style 1. Style 2 will very likely cause multiple |inclusions, which at best wastes time (the compiler has to process each |include every time), and at worst causes errors, since not all headers |can be included multiple times. The only exception is an include file, |whose only purpose is to include a set of headers that are needed in all |or most of the source files in a given project. Actually, if the include files are written correctly, very *little* time is wasted and no errors are produced. It's a simple matter of wrapping the include file in: #ifndef _STDIO_H_ #define _STDIO_H_ . . #endif /* _STDIO_H_ */ Personally, I have found that nested includes are both convenient, and make a great deal of sense. -- Michael Stefanik, MGI Inc, Los Angeles | Opinions stated are never realistic Title of the week: Systems Engineer | UUCP: ...!uunet!bria!mike ------------------------------------------------------------------------------- If MS-DOS didn't exist, who would UNIX programmers have to make fun of?