3 ms·
Seeing how the Rust community seems to have converged on using `uint` as the default type for array indexing and so on; wouldn't it make sense to reflect that i
by thomasahle 12y ago
Seeing how the Rust community seems to have converged on using `uint` as the default type for array indexing and so on; wouldn't it make sense to reflect that in the complexity of the name of the types?
Instead of (uint, int) we could have (int, sint) or (uint, sint).
- dilap 12y agoYou are going to confuse a hell of a lot of people if you make int mean "unsigned integer"!
- steveklabnik 12y ago> wouldn't it make sense to reflect that in the complexity of the name of the types? There has been a huuuuuge amount of discussion about int/uint and naming, expect some clarification sometime soonish, as any changes (if any) would have to be made soon.
- Igglyboo 12y agoNo because it will confuse people from pretty much every other language that uses 'int' to mean 'signed integer'.
- zcdziura 12y agoJust for legacy sake, it probably wouldn't make sense to switch the meaning of 'int' in Rust to 'uint', whilst creating a new type 'sint' to emulate the old meaning of 'int'. Legions of up-and-coming developers have learned what an integer is, and it would be incredibly counter-productive to change up that definition for one particular programming language.
- vowelless 12y agoIn addition to what the others have said, it would also be semantically incorrect. Integers in mathematics are signed. So that terminology would not cross over very well.
- heinrich5991 12y agoYea, and it is being misused in a lot of places. In this project, `u32` would probably be a better fit as you try to serialize data – this should happen in a platform-independent way.