Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: PATCH change_specialist
Home

[Freeciv-Dev] Re: PATCH change_specialist

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: gregor@xxxxxxxxxxxxx
Cc: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: PATCH change_specialist
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 18 Dec 2001 12:04:36 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Tue, Dec 18, 2001 at 11:14:10AM +0100, Gregor Zeitlinger wrote:
> On Tue, 18 Dec 2001, Raimar Falke wrote:
> > If you move C code to Java you have to make also other transformations
> > (like replacing strcpy, or the iterate macros). So this boolean
> > problem is your smallest problem.
> well, but it's one less and makes the code more appealing for Java coders.
> 
> > Exactly. And this is the problem.
> >  boolean a;
> >  int b = a;
> > will not create an error (like java would). So the compiler can't use
> > the extra information.
> Ok. That's due to the lack of weak typing in C. I just did it that time to
> see the response, and if you agree I'd be happy to replace int with
> boolean everywhere. I'm convinced it will help readability. To lessen the
> chance of assining a boolean to an int, we could use something like a
> hungarian notation like bHasChanged instead of has_changed or say that has
> and is are also boolean prefixes. See my next email on this.

I'm not convinced that it will help. If something like this is made it
should allow the compiler to catch it. Something like Reinier's
struct. But even with this I don't see the typical programming errors
this will catch. Well there are function like could_unit_move_to_tile
which should be cleaned up with an enum.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Understanding is a three-edged sword; 
  your side, their side, and the truth."
    -- a well-known Vorlon



[Prev in Thread] Current Thread [Next in Thread]