Nullable types??
-
When there's an R in the month.
I hope you realise that hamsters are very creative when it comes to revenge. - Elaine
-
Bardy85 wrote:
What are YOUR thoughts?
Object reference not set to the instance of an object.
:..::. Douglas H. Troy ::..
Bad Astronomy |VCF|wxWidgets|WTLI'd reply, but I'm in the middle of an access violation...
¡El diablo está en mis pantalones! ¡Mire, mire! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! Personal 3D projects Just Say No to Web 2 Point Blow
-
When there's an R in the month.
I hope you realise that hamsters are very creative when it comes to revenge. - Elaine
bool areNullablesGood = ("the month".indexOf('R') >= 0); Well, that answers that.
Proud to have finally moved to the A-Ark. Which one are you in? Developer, Author (Guardians of Xen)
-
I'd reply, but I'm in the middle of an access violation...
¡El diablo está en mis pantalones! ¡Mire, mire! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! Personal 3D projects Just Say No to Web 2 Point Blow
Jim Crafton wrote:
but I'm in the middle of an access violation...
Don't want to know. Don't want to know. Don't want to know. :-D
:..::. Douglas H. Troy ::..
Bad Astronomy |VCF|wxWidgets|WTL -
bool areNullablesGood = ("the month".indexOf('R') >= 0); Well, that answers that.
Proud to have finally moved to the A-Ark. Which one are you in? Developer, Author (Guardians of Xen)
-
Jim Crafton wrote:
but I'm in the middle of an access violation...
Don't want to know. Don't want to know. Don't want to know. :-D
:..::. Douglas H. Troy ::..
Bad Astronomy |VCF|wxWidgets|WTLSounds like you're suffering from a stack overflow?
¡El diablo está en mis pantalones! ¡Mire, mire! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! Personal 3D projects Just Say No to Web 2 Point Blow
-
but he did not specify whether having the R is good or not ;P
No matter how long he who laughs last laughs, he who laughs first has a head start!
You noticed. :laugh:
I hope you realise that hamsters are very creative when it comes to revenge. - Elaine
-
They are good when you need a nullable type. Or, when you need compatibility with other platforms (while designing web services contracts, for example).
If you truly believe you need to pick a mobile phone that "says something" about your personality, don't bother. You don't have a personality. A mental illness, maybe - but not a personality. - Charlie Brooker My Photos/CP Flickr Group - ScrewTurn Wiki
-
Nullable or Not. That is the question. Are they good or are they bad? What are YOUR thoughts?
Bardy85 wrote:
Are they good or are they bad?
Neither. You use the correct tool for the job. Nullable types are just another tool in the toolbox. They serve a specific surpose. I don't qualify them as "good" or "bad".
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
Sounds like you're suffering from a stack overflow?
¡El diablo está en mis pantalones! ¡Mire, mire! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! Personal 3D projects Just Say No to Web 2 Point Blow
Jim Crafton wrote:
Sounds like you're suffering from a stack overflow?
Sounds like a medical condition that afflicts older developers. [cue drug company commercial here] Do you suffer from Stack Overflow? Is this affecting your love life? Work? Family? Friends? Millions of aging Software Developers, like you, live with SOF everyday. Well, worry no more. With Stacagra, you'll regain your confidence and management over your Stack once again. :rolleyes:
:..::. Douglas H. Troy ::..
Bad Astronomy |VCF|wxWidgets|WTLmodified on Monday, August 3, 2009 11:54 AM
-
Bardy85 wrote:
Are they good or are they bad?
Neither. You use the correct tool for the job. Nullable types are just another tool in the toolbox. They serve a specific surpose. I don't qualify them as "good" or "bad".
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...True. What ever is best for the job. Simple. easy. For some reason when I code, I sit for hours wasting time, trying to find the best way foward. I know there are always a handfull of ways to accomplish a given task. I'm just trying to find the "best",most effecient,simplest solution. Maybe that it. Time. Every ms counts. Oh well. Think it's just monday driving me up the wall. Thanks anyway.
-
I'd reply, but I'm in the middle of an access violation...
¡El diablo está en mis pantalones! ¡Mire, mire! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! Personal 3D projects Just Say No to Web 2 Point Blow
Are you violating MS Access? :rolleyes:
-
Nullable or Not. That is the question. Are they good or are they bad? What are YOUR thoughts?
Once I met one that was really, really bad... :rolleyes:
-
bool areNullablesGood = ("the month".indexOf('R') >= 0); Well, that answers that.
Proud to have finally moved to the A-Ark. Which one are you in? Developer, Author (Guardians of Xen)
Ian Shlasko wrote:
bool areNullablesGood = ("the month".indexOf('R') >= 0);
That seems pretty close to the truth, as (1) months have at most one capital letter (never an R), (2) and "the month" has none. :)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
-
Are you violating MS Access? :rolleyes:
-
True. What ever is best for the job. Simple. easy. For some reason when I code, I sit for hours wasting time, trying to find the best way foward. I know there are always a handfull of ways to accomplish a given task. I'm just trying to find the "best",most effecient,simplest solution. Maybe that it. Time. Every ms counts. Oh well. Think it's just monday driving me up the wall. Thanks anyway.
Don't use them when you don't have to. Every time you call an API expecting a non nullable value you'll have to do validation/conversion of your nullables.
The European Way of War: Blow your own continent up. The American Way of War: Go over and help them.
-
Nullable or Not. That is the question. Are they good or are they bad? What are YOUR thoughts?
-
Nullable or Not. That is the question. Are they good or are they bad? What are YOUR thoughts?
Useless, because there's no mapping of a nullable type to an object with value DBNull.Value. Marc
I'm not overthinking the problem, I just felt like I needed a small, unimportant, uninteresting rant! - Martin Hart Turner
-
Nullable or Not. That is the question. Are they good or are they bad? What are YOUR thoughts?
Given that the inventor of null calls it his "billion dollar mistake[^]", I think it's safe to say null references are bad. Or did you mean
System.Nullable<T>
in the .NET framework?Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon Judah Himango
-
Nullable or Not. That is the question. Are they good or are they bad? What are YOUR thoughts?
I usually use them in conjunction with a database and linq. But I don't see why they can't be used whenever the need arises. http://qconlondon.com/london-2009/presentation/Null+References:+The+Billion+Dollar+Mistake[^]
Todd Smith