toString vs. toUtf8

renoX renosky at free.fr
Mon Nov 19 21:44:11 PST 2007


Jason House a écrit :
> Walter Bright wrote:
> 
>> Gregor Richards wrote:
>>> Would you prefer if int => int32, long =>
>>> int64, short => int16, byte => int8, real => float80 (portability be
>>> damned), double => float64, float => float32? They'd certainly be more
>>> obvious, but I can tell you I'd go crazy.
>> Those get requested now and then, but I agree they are awful. They're a
>> legacy from the C world where the sizes of basic types are unknown.
> 
> The first bullet on http://www.digitalmars.com/d/portability.html implies
> some wiggle room on this issue.
> 
> I really liked how D got rid of size ambiguity at first... all the way until
> I started developing on machines that were not 32 bit.  When I don't care
> about the true size, I feel guilty using "int" all over the place because
> it is a fixed size.
> 
> I'd love to see both a fixed and variable size option available.  Maybe:
> int - variable size
> int32 - fixed size
> int64 - fixed size
> 
> If that's done, the size of types become obvious when the programmer cares
> about them and may make size-sensitive code more obvious.

No!
Naturally programmers would use 'int' everywhere and this would create 
again portability issue.

var_int, int_be32 (bigger or equal 32 bit), int_word: would be ok though.

renoX



More information about the Digitalmars-d mailing list