Hey Guys, I have a simple question about choosing primitive types.
Usually when I create a variable, I try to choose the smallest type possible that can handle the "range requirements" for that variable. So for example if I use a byte variable anywhere in my code I know for sure that the variable would never need to go beyond the range of [0 - 255]. I guess the philosophy here is... if you don't need it don't use / allocate it.
Now that's all fine and dandy, but my problem comes in when I perform operations on those variables.. more specifically variables of type byte.
Simple operations like (just an example)...
byte var = 0;
var = var + 10;
..forces me to cast the resulting value back into a byte.
byte var = 0;
var = byte(var + 10);
My question is... how expensive do you think these conversions are and do you think the cost of the conversions are worth the reduction in memory usage?