[Freeciv-Dev] Re: Profiling Civserver again
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Thu, Aug 02, 2001 at 04:06:18AM +0100, Vasco Alexandre Da Silva Costa wrote:
> On Wed, 1 Aug 2001, Ross W. Wetmore wrote:
>
> > It is also unsafe. Boolean TRUE values are undefined by the standards, and
> > there is no guarantee that this is not represented by any non-zero set of
> > bits. You need to do this as (X >= 0 ? 1 : 0) to be 100% safe.
>
> Please read ANSI X3.159-1989 section 3.3.8.
> I get sad each time i see people busting their finges typing such futile
> monstruosities as you typed above (they even make the code more
What a strange stance.
You think relying on the type coercion rules of C is a good technique
to make code clear? Surely not! I'll grant you that many shorthands
are convenient, but they certainly don't make the code more clear.
Consider someone with their background in some (any) other language.
They may be pretty unsure about the implicit conversions from boolean
to int. (False --> 0 is a fairly natural guess, but true could easily
be represented by -1, IMO).
(X>=0 ? 1 : 0) makes it totally clear (as long as they know the ?
operator, of course!)
Jules
- [Freeciv-Dev] map_adjust_x (was: Profiling Civserver again), (continued)
- [Freeciv-Dev] Re: Profiling Civserver again, Vasco Alexandre Da Silva Costa, 2001/08/01
- [Freeciv-Dev] Re: Profiling Civserver again, Ross W. Wetmore, 2001/08/01
- [Freeciv-Dev] Re: Profiling Civserver again, Robert Brady, 2001/08/01
- [Freeciv-Dev] Re: Profiling Civserver again, Vasco Alexandre Da Silva Costa, 2001/08/01
- [Freeciv-Dev] Re: Profiling Civserver again, Trent Piepho, 2001/08/01
- [Freeciv-Dev] Re: Profiling Civserver again, Vasco Alexandre Da Silva Costa, 2001/08/01
- [Freeciv-Dev] Re: Profiling Civserver again, Trent Piepho, 2001/08/02
- [Freeciv-Dev] Re: Profiling Civserver again, Greg Wooledge, 2001/08/02
- [Freeciv-Dev] Re: Profiling Civserver again,
Jules Bean <=
- [Freeciv-Dev] Re: Profiling Civserver again, Gaute B Strokkenes, 2001/08/06
- [Freeciv-Dev] Re: Profiling Civserver again, Gaute B Strokkenes, 2001/08/02
- [Freeciv-Dev] Re: Profiling Civserver again, Paul Zastoupil, 2001/08/02
- [Freeciv-Dev] Re: Profiling Civserver again, Lino Mastrodomenico, 2001/08/03
- [Freeciv-Dev] Re: Profiling Civserver again, Gaute B Strokkenes, 2001/08/03
- [Freeciv-Dev] Re: Profiling Civserver again, Gaute B Strokkenes, 2001/08/04
|
|