From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <9ddc336b5437f42b2ca0bef18c45ad3d@vitanuova.com> To: 9fans@cse.psu.edu Subject: Re: [9fans] new compilers Date: Mon, 27 Mar 2006 18:31:34 +0100 From: rog@vitanuova.com In-Reply-To: <1388b3a83891b000d624805b51308b94@plan9.bell-labs.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: 22c753c0-ead1-11e9-9d60-3106f5b1d025 > I find the notion of pre-compiled headers for anything other than > a very special situation rather odd. it is odd. i've just been playing with trying to get some stuff working under macos x, and the interfaces are just amazing. the standard approach seems to be to enumerate every possible situation (often literally, with enums) in the interface. a few days ago i did a little test, just to appreciate the full extent of things. cpp of a null source file (with only the #includes i needed) gave over 100,000 lines of code. there were at least 20,000 enum constants defined, with names such as kAudioHardwarePropertyBootChimeVolumeRangeDecibels, and kAudioFormatProperty_AvailableEncodeChannelLayoutTags. and the interfaces that are presented are almost unusable even if you take that on board. i've been looking at the audio interfaces; functionality provided by the system includes facilities to read mp3 files, do sample-rate conversion, and produce sound output, so i thought, as a first test, i'd try to play an mp3 file. i haven't succeeded yet. after struggling for a good while, i found some example code that does this. it's over 1000 lines of code. when it should be about 10. i'd think perhaps it was deliberate, if it didn't all seem so carefully done, with loving attention given to every misbegotten line of header file. as charles put it recently, with relation to usb: ``enough is specified to make it complicated, but not enough to be complete, once for all.'' so true. given that kind of programming environment, the decision to use precompiled headers becomes slightly more understandable, i suppose. i guess the only good thing is that by using interfaces like that, they'll be wasting countless man-hours of programmer time, potentially allowing those using smaller, smarter interfaces a competitive advantage. yeah right.