DMD 1.019 and 2.003 releases

0ffh spam at frankhirsch.net
Wed Jul 25 03:36:25 PDT 2007


Derek Parnell wrote:
> On Tue, 24 Jul 2007 20:55:41 -0400, Robert Fraser wrote:
> 
>> for(int i = 100; i; i--) // Takes a second to mentally figure out what's going on
> 
> I'm still not explaining myself I guess. Yes, it doesn't take much to work
> out what the compiler is going to generate for that code. But that is not
> the issue I'm addressing. 

I think maybe you wanted to address me here, not Robert.
A second is a looonng time! :)

> If however, one gets used to typing 'i>0' or similar fully specified comparisions,
> we all have a better confidence level that the code is written as intended to be written.
> Of course, it is not a way to prevent all errors, but just a technique to
> reduce coding errors.

I know the argument well. I use it myself to argue for fully braced
expressions instead of relying on operator precedence (apart from
the usual exceptions). Also, braces will actually help me parsing.

BUT there is a huge difference here: I'll repeat it this once before
stopping to do this (I don't believe in reiteration contests):

Using integers or pointers as bools is

   1. /Easy/ to understand and use correctly
   2. /Shorter/ - less to type and less to take in - and therefore
   3. /Faster/ to parse mentally (once you're used to it), also it's
   4. Not obligatory for those who feel uncomfortable with it, but
   5. Looks one darn hell better
      than having a detrimental tumour of nop characters attached.

> I write program code for humans not for computers. It's the compiler's job
> to prepare it for the computer.

Source code is for humans, machine code for computers, so far we agree.
But source code is for a /subclass/ of humans only: Those who are
knowledgeable in the programming language that was used. If I don't know
Miranda I will sure as heck not complain to Miranda programmers about their
unreadable code, because it is /my friggin fault/.
If I code in Miranda and I produce a bug because I do not understand the
mechanisms involved, it is still /my friggin fault/.

> Sorry that this sounds so pompous and self-righteous. That is not how I'm
> trying to sound.

Blast, don't kick yourself! I'll do that! :)

Regards, Frank The Eternally Distracted




More information about the Digitalmars-d-announce mailing list