Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!goblin1!goblin3!goblin.stu.neva.ru!news.ripco.com!news.glorb.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!spln!extra.newsguy.com!newsp.newsguy.com!news2 From: Michael Wojcik Newsgroups: comp.lang.java.programmer Subject: Re: =?UTF-8?B?QW5kcm9pZOKAlFdoeSBEYWx2aWs/?= Date: Tue, 07 Jun 2011 11:59:49 -0400 Organization: Micro Focus Lines: 53 Message-ID: References: NNTP-Posting-Host: p9ce4bd83e1412a11af0ca97a17901a16ca7e8eef9c9d73be.newsdawg.com Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.5.0 In-Reply-To: Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5092 BGB wrote: > On 6/3/2011 5:23 PM, Lawrence D'Oliveiro wrote: >> In message, Michael Wojcik wrote: >> >>> Once again, the real problem is that systems like autoconf only help >>> with C code that is written to be portable with the help of >>> conditional compilation. The vast majority of C code is poorly written >>> (spend some time on comp.lang.c if you don't understand how or why) >>> and a good portion of that is unportable assumptions. >> >> That would certainly not be true with the vast majority of Free Software >> written in C/C++. Which is the main kind of C/C++ code that I deal with. > > note that he was apparently also objecting to the use of "conditional > compilation" as a portability strategy (IOW: "lots of #ifdef"). That's not exactly how I'd interpret what I wrote. I object to writing non-portable code as a portability strategy. That said, a lot of conditional compilation (setting aside the question of defining "a lot") is not a good sign. At the very least it suggests some refactoring is called for. > however, "#ifdef" is one of the main portability strategies with most > FOSS, and actually most software in general. That seems plausible, though cumbersome to verify. > the issue though is that the requirements for making "proper" portable > software (IOW: not using piles of "#ifdef"s) is generally very > awkward/painful, and limits what sorts of things one can do, and doesn't > really buy all that much. > > most people, really, probably don't care that much if the software they > are using has a few ifdef's here or there, they just care that it works. There's a great deal of room between "piles of" and "a few". I'll claim - without support, since this nonsense has gone on long enough - that it is generally possible to cleanly refactor C programs into portable and platform-specific parts, and thereby greatly reduce the amount of conditional compilation. (In fact, the conditional compilation can be hoisted into the build system, with individual per-platform source files, thereby eliminating all in-source conditional compilation. In some applications this is a reasonable approach.) -- Michael Wojcik Micro Focus Rhetoric & Writing, Michigan State University