Click here to Skip to main content
15,920,513 members

Survey Results

Do you use null values or magic numbers?   [Edit]

Survey period: 11 Dec 2006 to 17 Dec 2006

Many languages allow you to store null values in place of actual data. If you have no data for a value do you null it or store, say, -1?

OptionVotes% 
I always use null values in code49937.18
It depends on the situation74255.29
I never use null values in code1017.53



 
GeneralRe: In C#, please use MinValue or MaxValue. Pin
Kamarey16-Dec-06 22:42
Kamarey16-Dec-06 22:42 
GeneralRe: In C#, please use MinValue or MaxValue. Pin
jhwurmbach18-Dec-06 2:38
jhwurmbach18-Dec-06 2:38 
GeneralRe: In C#, please use MinValue or MaxValue. Pin
Ri Qen-Sin22-Dec-06 14:09
Ri Qen-Sin22-Dec-06 14:09 
GeneralThe default keyword Pin
WillemM11-Dec-06 5:40
WillemM11-Dec-06 5:40 
GeneralRe: The default keyword Pin
Steve Hansen12-Dec-06 23:03
Steve Hansen12-Dec-06 23:03 
GeneralDBNull Pin
Marc Clifton11-Dec-06 2:18
mvaMarc Clifton11-Dec-06 2:18 
GeneralRe: DBNull Pin
Kevin McFarlane17-Dec-06 8:46
Kevin McFarlane17-Dec-06 8:46 
Generalnull value isn't always undesirable Pin
redclover11-Dec-06 1:38
redclover11-Dec-06 1:38 
it depends on the situation. Sometimes you are using and object instance that doesn't have an "Empty" value so its easier to use null value instead. Also null value may help you find out that the variable has not been used or isn't needed anymore.
GeneralNo-value is different from null-value Pin
Emilio CL10-Dec-06 23:38
Emilio CL10-Dec-06 23:38 
GeneralNullable types in C# rock. Pin
stano10-Dec-06 23:09
stano10-Dec-06 23:09 
GeneralIt's convenient Pin
Michael Dunn10-Dec-06 18:47
sitebuilderMichael Dunn10-Dec-06 18:47 
GeneralRe: It's convenient Pin
Jörgen Sigvardsson12-Dec-06 11:44
Jörgen Sigvardsson12-Dec-06 11:44 
Generalit depends Pin
Pharago10-Dec-06 18:03
Pharago10-Dec-06 18:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.