DMD 1.019 and 2.003 releases

Derek Parnell derek at nomail.afraid.org
Tue Jul 24 00:03:31 PDT 2007


On Tue, 24 Jul 2007 08:39:49 +0200, 0ffh wrote:

> Derek Parnell wrote:
>> I use ...
>> 
>>  char c;
>>  int v = (cast(int)c - '0')
>> 
>> To me it the same as assuming that boolean values are integers.
> 
> You suggest writing things like
> 
>    for (int c=0x100;c!=0;--c) {...}
> 
> or
> 
>    for (int c=0x100;cast(bool)c;--c) {...}
> 
> ?

Yep. That's how I tend to do my non-assembler coding, but with a lot more
white space, less 'jargon', and avoid magic numbers :-)

  const MaxWidgetCount = 256;
  for (int lRemaining = MaxWidgetCount; lRemaining != 0; lRemaining--)
  {
      ...
  }
 
> UGH! :-)
>
> Maybe another example what systems programming language might mean:
> A language that encourages the programmer to know what is going on
> behind the scenes, after compilation, and allows her to make use of
> that knowledge.
> If I know that testing a condition is nothing but comparing a number
> to zero, writing "if (number!=0)" just becomes redundant.

I'm different. I write code so other people can read it with as little
effort as possible ... and sometimes I even succeed <G>

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
24/07/2007 4:53:26 PM



More information about the Digitalmars-d-announce mailing list