[Freeciv-Dev] Re: Profiling Civserver again
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Thu, 2 Aug 2001, jules@xxxxxxxxxxxxxxx wrote:
> 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.
These aren't the type coercion rules.
Personally, I belive that in cases like these it is best to use `if
(fubar)' iff fubar can reasonably be interpreted as a truth value, and
`if (fubar != 0)' otherwise. For instance, I don't like `if
(x_coordinate)' and suchlike.
> 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).
If anyone knows _that_ little about C, then they shouldn't be using
it. A little knowledge is a dangerous thing...
--
Big Gaute http://www.srcf.ucam.org/~gs234/
Is there something I should be DOING with a GLAZED DONUT??
- [Freeciv-Dev] Re: map_adjust_x (was: Profiling Civserver again), (continued)
- [Freeciv-Dev] Re: map_adjust_x (was: Profiling Civserver again), Reinier Post, 2001/08/02
- [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, 2001/08/02
- [Freeciv-Dev] Re: Profiling Civserver again,
Gaute B Strokkenes <=
- [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
|
|