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
31 Days Ago
Explain why data typing helps the programmer when writing a program
Reply With Quote Quick reply to this message  
Join Date: Aug 2009
Posts: 391
Reputation: Ryshad has a spectacular aura about Ryshad has a spectacular aura about Ryshad has a spectacular aura about 
Solved Threads: 71
Ryshad's Avatar
Ryshad Ryshad is offline Offline
Posting Whiz
 
0
  #2
31 Days Ago
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,710
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: 483
Moderator
adatapost's Avatar
adatapost adatapost is offline Offline
Posting Maven
 
0
  #3
30 Days Ago
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; 30 Days Ago at 2:46 am.
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC