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: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: PATCH change_specialist
From: Gregor Zeitlinger <zeitling@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 18 Dec 2001 11:14:10 +0100 (CET)
Reply-to: <gregor@xxxxxxxxxxxxx>

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.

-- 
Gregor Zeitlinger
gregor@xxxxxxxxxxxxx



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