[Freeciv-Dev] Re: PATCH change_specialist
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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
- [Freeciv-Dev] Re: PATCH change_specialist, (continued)
- [Freeciv-Dev] Re: PATCH change_specialist, Raimar Falke, 2001/12/17
- [Freeciv-Dev] Re: PATCH change_specialist, Gregor Zeitlinger, 2001/12/17
- [Freeciv-Dev] Re: PATCH change_specialist, Raimar Falke, 2001/12/17
- [Freeciv-Dev] Re: PATCH change_specialist, Gregor Zeitlinger, 2001/12/17
- [Freeciv-Dev] Re: PATCH change_specialist, Stewart Adcock, 2001/12/17
- [Freeciv-Dev] Re: PATCH change_specialist, Adam Olsen, 2001/12/17
- [Freeciv-Dev] Re: PATCH change_specialist, Gregor Zeitlinger, 2001/12/17
- [Freeciv-Dev] Re: PATCH change_specialist, Stewart Adcock, 2001/12/17
- [Freeciv-Dev] Re: PATCH change_specialist, Raimar Falke, 2001/12/18
- [Freeciv-Dev] Re: PATCH change_specialist, Gregor Zeitlinger, 2001/12/18
- [Freeciv-Dev] Re: PATCH change_specialist,
Raimar Falke <=
- [Freeciv-Dev] Re: PATCH change_specialist, Reinier Post, 2001/12/17
|
|