This has been debated a few times on the NGs.
In general, the consensus is to use the Short, Integer, and Long keywords.
They of course translate directly to the Int16, 32, and 64 data types.
The debate has mostly been "will the underlying type vary in the future?"
At some point, it probably will, just has it has changed now.
But that time isn't in the foreseeable future. Maybe when the standard
processor architecture is 128bit or something.
However, in the cases where you know you need a specific size, which is
usually limited to external API calls and I/O, then I prefer to explicitly
declare the size. For me, when I see a declaration of Int32, that tells me
that I know I need exactly 32 bits for some reason. While it is no different
than "Integer", it is more "explicit" and serves as a flag to me when
reading my code later on that it might not be safe to alter the size.
As far as platform dependence, .NET has given us the IntPtr (Integer
Pointer) type. This is the one you should pay attention to. The underlying
type can vary based on whether you are on a 32 or 64 bit platform. Clearly
it should be used for pointers.
Gerald
"Shawn Berg" <sh***@saeweb.com> wrote in message
news:eY*************@TK2MSFTNGP12.phx.gbl...
Is the Integer data type deprecated? I am not sure what Integer data type
to use in some of my classes.
According to the URL below, if I am reading it correctly, it seems as
though I should be using the Short, Integer, and Long data types. Is this
correct? Or should I instead be using the Int16, 32, and 64 data types in my code?
Whats the best practice here?
http://www.ondotnet.com/pub/a/dotnet...b7.html?page=2