I think this question arises, is that 10 years ago it was common practice to think about what values โโyou need to store variables, and if, for example, you save a percentage (0,100), you can use bytes (from - 128 to 127 signed or from 0 to 255 unsigned), since it was large enough for the job and, therefore, was considered less "wasteful."
These days, however, such measures are not needed. The memory is usually not that big, and if you would probably be defeated by modern computers, aligning everything to 32-bit word boundaries (if not 64).
If you do not store arrays of thousands of these things, then such types of microoptimization (now) are an irrelevant distraction.
Honestly, I donโt remember how the last time I didnโt use bytes for anything other than raw data, and I canโt remember the last time I used short, well, anything.
cletus
source share