|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Data typesI'm really curious on something. I just jumped to the 2005 platform and I
noticed something using the code snipplets. I have up to now been declaring my variables and properties with Int64, Int32, Int16. However, I notice that the code snipplets do it as Double, Integer, and Short. What the heck is the difference? Is one way the better ".NET" way than the other? Also which is better to use: Date or DateTime? TIA Steve Steve,
I wished there was a difference, but they stopped with it. An Integer at the moment the same as an Int32. If they had not don that, than the integer could have been on a 64 bits computer a Int64 and been processed something quicker on a 64bit system, without code change. Int32 could than be used to describe a real Int32, by instance to be used in an API and Integer as the most efficient (processing) value. I use it however in that way. An Int32 in my programmes describes a real Int32 and an Integer the most optimal to use value. An int64 is a Long (Integer) while Short (Integer) is a 16Bit Value. A Double is a 8 bytes double precision floating point value. A date and datetime are the same, it holds forever a datetime value. I use forever DateTime from which the date part is datetime.date I hope this gives an idea. Cor "Steve Peterson" <speterson@nospam.com> schrieb: 'Byte', 'Short', 'Integer', etc. are just aliases for 'UInt8', 'Int16', > I'm really curious on something. I just jumped to the 2005 platform and I > noticed something using the code snipplets. I have up to now been > declaring my variables and properties with Int64, Int32, Int16. However, I > notice that the code snipplets do it as Double, Integer, and Short. What > the heck is the difference? Is one way the better ".NET" way than the > other? Also which is better to use: Date or DateTime? 'Int32', etc. I suggest to use 'Integer', etc. because they seem more natural in VB.NET. 'Date' is simply an alias for 'DateTime'. Note that the type aliases are colored differently from the other types in the VS.NET IDE's text editor. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/>
Coding Standards - We need a hero
TextBox MAPI Q: DataGrid Select Shutdown a list of computers using VB.net Need equivalant code in VB.Net 2005 ? "friend" accessor and inherited forms Waht is the fastest/bets? Outlook Object/CDO/Redemption/...? TCPListener / GUI Responsivness Calling all (any?) NDoc'ers |
|||||||||||||||||||||||