From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Date: Wed, 2 Aug 2000 09:53:55 +0000 From: "Douglas A. Gwyn" Message-ID: <3987ED0B.CFFF496C@home.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit References: <200008011335.JAA17292@cse.psu.edu> Subject: Re: [9fans] Installing the updates Topicbox-Message-UUID: f29d9f18-eac8-11e9-9e20-41e7f4b1d025 rob pike wrote: > To meet that goal, we had to break with the ANSI include rules. I don't see why. The C standard does *not* say that you *must* include any header multiple times; you can enforce Plan9 programming discipline regardless of whether headers have internal idempotency locks. The presence or absence of such locks has no effect on Plan9-style applications that #include every header needed, once apiece in whatever the proper order is. Indeed, the Plan9 header discipline imposes an interdepency ordering upon the system headers, such that e.g. and cannot both define something that the other header needs, which might otherwise be a natural thing to do. It is nice that Plan9 programs don't individually use #ifdefs and config, but really the use of centrally-defined types and macros in a common environment avoids such stuff. In effect, the differences are factored out to a global level. The reason for remaining #ifdefs in many actual applications is that they have to work in many environments that differ in much more radical ways than any two instances of Plan9. There are ways of factoring out the differences, and I generally recommend them in the design phase, but most applications are created by people who don't know (or care) about all the ways other environments differ from the one where they do their development, and some other poor sap later on is stuck with porting their code. Repackaging the whole thing might not be feasible, so patching places where problems crop up using #ifdefs is expedient. (More work for the *next* poor sap.) It would be nice if everybody had the experience and foresight to design his code properly in the first place, with all system dependencies isolated modularly, but in the real world that seldom seems to happen.