uint got renamed to
usize (yay!), the respective literal suffixes were renamed to
us. However, the meaning of these suffixes is less than self-evident, and even knowing them, I find that it takes my brain a moment to assign them the correct meaning when reading code. A single ‘s’ isn’t really enough to evoke ‘size’, and this is exacerbated by the fact that ‘is’ and ‘us’ have other, more common meanings that must first be considered and ruled out. Both are English words, and
42us could additionally be interpreted as “42 microseconds”, or even just “42 unsigned”, which loses some meaning. While it as likely that I’ll get more used to seeing
us as indicating
usize over time, I think it is worth discussing and considering a couple of alternatives.
The most clear suffixes would be
usize. This matches the convention set by the fixed-size integer types of having the type name match the suffix, and doesn’t leave any room for misinterpretation. A few people on the renaming RFC suggesting starting with these and only shortening them if they turned out to be too unergonomic.
If we do want shortened suffixes, I would propose using
usz. These are the same length as most of the fixed-size suffixes, and are much better at evoking
usize. They also don’t suffer from the problem of having overloaded meanings.
If we had to go with a two character suffix, I would even prefer
us, which, while less clear than the above options, still seems more so than the status quo. It at least avoids some of the meaning overload, lessening the mental burden.