Total members 9950 | Gratitudes |It is currently Sat Feb 11, 2012 3:04 am Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 1 post ] 
Author Question
 Question subject: Data Type in Programming
PostPosted: Wed Feb 24, 2010 12:03 pm 
Offline
Newbie
User avatar

Joined: Wed Feb 24, 2010 11:52 am
Posts: 1
Has thanked: 0 time
Have thanks: 0 time

Data Type in Programming!!

Here I am sharing some of my early experiences in Programming. When we write code for any application, generally we concentrate on Business Logic and different features available to meet the Business Logic. Whatever applications we are working on, we are ultimately playing with data .The placeholder for the Data is the variables/fields/properties, etc. When we are declaring data type for a variable, generally we don’t give much emphasis at that point. Here some points we need to take care
My Experience No 1:

I declared a variable as “int” data type for a PatientId. It worked fine in local, but when that code went to LIVE, the application gave exception because in LIVE PatientId is too long to accommodate in int data type.

So before declaring any variable we need to consider all the situations, application scope, environment .Even one code may be working fine today, after 1/ 10/20 days/months/years it will fail due to just due to data type declaration mistake.

Think more; write less is the policy for better programming.

My Experience No 2:

I declared a variable as int data type which was a placeholder for a result status (meaning, based on the result status that variable varies from 0/1/2/3. It can contain only these four values).

“int” data type is 4 byte integer in C#. But I can declare this variable as “sbyte” which represents a 1 byte integer. Since that variable contains only 1 or 2 or 3 or 4, declaring the variable as “int” is wastage of memory space.

Before declaring any variable we need to just think of the memory space needed for that variable, our requirement, any other good alternative for this variable.

Eliza

http://www.mindfiresolutions.com/Data-Type-in-Programming-426.php


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 1 post ] 
Quick reply


  


 Similar topics
 Topic title   Forum   Author   Comments 
 programming  C-C++  Anonymous  0
 Data Encryption Standard (DES)  Finished Projects  msi_333  13
 How to make PHP form data saved into txt file  PHP  Radu  6
 set MIME type in link  HTML examples  msi_333  0
 charm algorithm in data mining  Java  Anusha123  3

All times are UTC [ DST ]


Users browsing similar posts

Users browsing this forum: No registered users and 1 guest



Jump to:  
Previous Question | Next Question 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team