Recently, I had to implement a business rule in a certain project. The rule basically consisted of checking a range between 1 and 12, values that would be used later, in some way, with Bootstrap.
First, since it is a numeric data type, I declared it as int. However, as the range wasn't that big, I started to question whether I should really use the int or byte type.
We know the difference between int and byte. I thought using byte would be enough for such a business rule, as int would consume more memory space.
Now, I've been looking at a few other projects — some prominent ones on the market, and it looks like they use the int type in, let's say, a variable that defines the size of a hash's salt.
I believe that in my case, and some others like this one from salt, using numeric data type byte would be better instead of int. However, maybe I'm not sure about this, so I'd like to hear the opinion of someone who has more knowledge and could argue better, so that I can remedy the doubt.