On 06/24/2012 08:27, Martin Dietze wrote:
> On Sat, June 23, 2012, Doug Barton wrote:
> 
>>> Have you looked at the code?  I want to get rid of ifdef hell.
>>
>> I hate to break this to you, but ifdef's are an unfortunate fact of life
>> in a cross-platform world. Yes, they make life more difficult, but
> 
> Not quite. They're usually a symptom for poor software
> engineering and / or naive approach to cross-platform
> development.
> 
> Platform-dependent code should get modularized properly and
> then go into its own source files, so that one should usually
> not see any more prepocessor conditionals other than some
> conditional #includes and some OS-dependent typedef and #define
> stuff in a header dedicated to this.

That's a wonderful "Programming 101" view of the world you have there.
:) Unfortunately, real code usually involves compromises that are quite
a bit messier than that. Particularly when doing what you suggest causes
more work, for a smaller benefit, than using an ifdef.

Don't get me wrong, I like what you're saying, and in an ideal world,
yes, it should be done that way. The problem is we don't always live in
an idea world. :)

Doug

-- 

    This .signature sanitized for your protection



-- 
To unsubscribe, send mail to [email protected].

Reply via email to