Conditional compilation inside asm and enum declarations

Rainer Deyke rainerd at eldwood.com
Tue Jul 14 15:59:53 PDT 2009


Walter Bright wrote:
> It's not about protecting idiots. It's about making the better way to do
> things the easier and more natural way, and making the worse more
> difficult.

Making the better way easy is a worthwhile goal.  Making the worse way
more difficult is not.  A programming language should never set out to
intentionally make things difficult for the programmer.  A feature that
is used in bad code now may eventually find use in new idioms that
improve the overall quality of code in the future.

> I have long, long experience with #ifdef's. I know how convenient it is
> to just plop those things in, like your first hit of heroin. I know how
> justifiable just that one little old #ifdef is. Then you add in another,
> and another, and another, and another, and eventually wonder how you
> wound up with such an impenetrable thicket of awfulness. My own code
> gets like that (despite my knowing better) and just about every long
> lived piece of C/C++/asm code I've run across.

When I encounter bad code, I often try to refactor it.  The overall
trend is that the quality of my code improves over time.


-- 
Rainer Deyke - rainerd at eldwood.com



More information about the Digitalmars-d mailing list