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.

I cannot really see any excuse for #ifdefs shredding the code's
control flow.

Cheers,

M'bert

-- 
----------- / http://herbert.the-little-red-haired-girl.org / -------------
=+= 
What would happen in a battle between an Enterprise security team, who always 
get killed soon after appearing, and a squad of Imperial Stormtroopers, who 
can't hit the broad side of a planet?  --Tom Galloway 


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

Reply via email to