D
Dr Malcolm McLean
The main reason is that anyone reading your code will do a doubleCan you give some specific examples of why unsigned int is better than
unsigned char when values are in the range 0-255? I know with respect
to performance and memory there can be a difference.
take, and say "unsigned char? What's going on here? Normally unsigned
chars are used for arbitrary bytes of data, but this looks like an
index/count/counter. Why has he chosen that data type?"
Eventually of course he'll figure it out, but every little bit of
difficulty adds to the cost of maintaining your code, in a
supercumulative manner. Two little bits of difficulty add more than
twice the cost of one little bit, because humans can tolerate a
certain amount of distraction and get overwhelmed by too much.