944,087 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 1102
  • VB.NET RSS
Nov 10th, 2009
0

Benefits of data typing

Expand Post »
Explain why data typing helps the programmer when writing a program
Reputation Points: 10
Solved Threads: 0
Newbie Poster
oluscoa is offline Offline
15 posts
since Nov 2009
Nov 10th, 2009
0
Re: Benefits of data typing
One of the key benefits of type casting is that you know how the compiler will treat your variables. In the classic example:
VB.NET Syntax (Toggle Plain Text)
  1. var x = 5
  2. var y = "37"
  3. var z = x + y

Some compilers would treat both variables as strings and concatenate them so x+y="537" whilst others would convert the string to an integer and result in x+y=42.

By defining types you know exactly what type of data is stored and how it is treated. It is also more efficient since the memory assigned to the variable will be sized according to the data it will hold, so smaller data types will take up less memory.
Reputation Points: 512
Solved Threads: 246
Nearly a Posting Virtuoso
Ryshad is offline Offline
1,260 posts
since Aug 2009
Nov 11th, 2009
0
Re: Benefits of data typing
How much ever space you need to store your data you require that much memory and datatypes gives you different amount of memory so you can choose based on your requirements.

Take a look at this article - http://en.wikipedia.org/wiki/Data_type
Last edited by adatapost; Nov 11th, 2009 at 2:46 am.
Moderator
Reputation Points: 2136
Solved Threads: 1228
Posting Genius
adatapost is offline Offline
6,527 posts
since Oct 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: Error in vb application: Argument Null Exception was unhandled.
Next Thread in VB.NET Forum Timeline: Synchronise time with remote time server





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC