Click here to Skip to main content
15,904,348 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



 
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 
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 
Especially with HANDLEs or other handle types (like HKEY), it's nice to have NULL or INVALID_HANDLE_VALUE as a sentinel to indicate that no clean-up is necessary.


--Mike--
Visual C++ MVP Cool | :cool:
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

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.