Benefits of data typing

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2009
Posts: 5
Reputation: oluscoa is an unknown quantity at this point 
Solved Threads: 0
oluscoa oluscoa is offline Offline
Newbie Poster

Benefits of data typing

 
0
  #1
Nov 10th, 2009
Explain why data typing helps the programmer when writing a program
Reply With Quote Quick reply to this message  
Join Date: Aug 2009
Posts: 449
Reputation: Ryshad has a spectacular aura about Ryshad has a spectacular aura about Ryshad has a spectacular aura about 
Solved Threads: 88
Ryshad's Avatar
Ryshad Ryshad is offline Offline
Posting Pro in Training
 
0
  #2
Nov 10th, 2009
One of the key benefits of type casting is that you know how the compiler will treat your variables. In the classic example:
  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.
Please don't take for granted the work that solvers do for you. Take the time to fully understand the code they give you so that you might adapt it to future problems.

"Learning is more than absorbing facts, it is acquiring understanding.” - William Arthur Ward
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 2,721
Reputation: adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of 
Solved Threads: 501
Moderator
adatapost's Avatar
adatapost adatapost is offline Offline
Posting Maven
 
0
  #3
Nov 11th, 2009
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.
Reply With Quote Quick reply to this message  
Reply

Message:




Views: 218 | Replies: 2
Thread Tools Search this Thread



Tag cloud for VB.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC