"David" <ch**************@yeehee.cschrieb:
If I have a loop that has a max value of say 20 why would I not want to
define the loop counter using a BYTE or SHORT as opposed to a INTEGER.
It seems in most books or samples they define fairly small numbers as
INTEGER.
'Integer' is IMO the natural choice. Note that bounds may change over time.
The range of 'Integer' is large enough for common scenarios. In addition,
'Integer' as a 32-bit data type is very suitable for 32-bit computers. Most
classes in the .NET Framework use 'Integer' for indices. Using other types
may require (implicit widening) type conversions.
However, 'Byte and 'Short' are not entirely useless. They are often
required in p/invoke scenarios and when reading binary data from streams
(files, network streams, etc.). Arrays of 'Byte' are typically used to
store raw binary data.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>