Conditional compilation inside asm and enum declarations

Bill Baxter wbaxter at gmail.com
Tue Jul 14 17:20:45 PDT 2009


On Tue, Jul 14, 2009 at 5:13 PM, Walter
Bright<newshound1 at digitalmars.com> wrote:
> Rainer Deyke wrote:
>>
>> 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.
>
> Why do C and C++ (and D) make it difficult to do:
>
>   char *p;
>   p |= 1;
>
> ? There's no implementation difficulty in accepting such and generating
> correct code for it. It's purely a matter of making what is generally
> considered to be bad practice harder to do. I've never heard anyone argue
> that this was a bad decision.

I've never ever needed to do that, or been the slightest bit tempted
to.  The operation doesn't make sense.  So I think the analogy is
inappropos.  In contrast, using the negation of a version makes plenty
of sense.  As does versioning out an entry in an enum that doesn't
apply for some reason.

---bb



More information about the Digitalmars-d mailing list