Re: autotools and programming style (was: Remove cdrtools)
On Tue, Aug 15, 2006 at 02:11:21PM -0500, Steve Greenland wrote:
> No, you don't #ifdef all the users, you write multiple versions of a a
> generic function that hides the differences, and compile the appropriate
> one. Read the reference I gave.
> Sure, you *could* do this with autoconf driving the compilation, but
> nobody ever does. They just write a spaghettied mess in the main body of
> the code, like the examples.
On the bright side, with autoconf there's a plausible chance that people
will be writing such spaghetti based on feature testing rather than
writing such spaghetti based on platform detection defines exported by
the system. Not brilliant but it's a bit of a win.
> > it work in their systems (with absolutely no design goal in mind while
> > porting).
> Absolutely. But that doesn't justify crap code. The whole autoconf
> system encourages minor patches and nasty #ifdefs rather than factoring
> out what's different from what's the same.
I don't really think it's fair to blame autoconf for people writing
tasteless code: the whole masses of ifdefs thing is a fairly standard
danger sign that crops up even without autoconf providing the defines
and it does have a fairly standard solution.
"You grabbed my hand and we fell into it, like a daydream - or a fever."