Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!asuvax!ncar!gatech!bloom-beacon!eru!hagbard!sunic!news.funet.fi!hydra!cc.helsinki.fi!wirzenius From: wirzenius@cc.helsinki.fi (Lars Wirzenius) Newsgroups: comp.lang.c Subject: Re: A question on C programming style Message-ID: <1991Apr13.144026.5969@cc.helsinki.fi> Date: 13 Apr 91 14:40:26 GMT References: <1991Apr12.103621.8907@umiami.ir.miami.edu> Organization: University of Helsinki Lines: 18 In article <1991Apr12.103621.8907@umiami.ir.miami.edu>, bxpfac@umiami.ir.miami.edu writes: > How do the guru's on the net feel about the following two styles? (Uh, more like a bandwith-waster, I'm afraid...) > Style 1: (No nested includes - user responsible for proper order of includes). > Style 2: (Nested inclusion [each header includes everything it needs > included before it]). 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. -- Lars Wirzenius wirzenius@cc.helsinki.fi