Nullable types??
-
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
-
Well, all value types are non-nullable by default. You can make them nullable by wrapping them in a class. This is done automatically in .NET with the "?" operator.
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
-
Well, all value types are non-nullable by default. You can make them nullable by wrapping them in a class. This is done automatically in .NET with the "?" operator.
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
Yeah... And boy is that not slick. :rolleyes: ("Yay!" i thought to myself, upon hearing of this for the first time... "Now i can write generic code that treats value types and reference types the same!" The gods of .NET proceeded to laugh heartily at my naivete...)
-
Using my astounding precognitive powers, I predict that this will be a pointless thread.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001John Simmons / outlaw programmer wrote:
Using my astounding precognitive powers, I predict that this will be a pointless thread.
I knew you were going to say that.
Jon "One loves to possess arms, though they hope never to have occasion for them." --Thomas Jefferson to George Washington, 1796. Soap Box 1.0: the first, the original, reborn troll-less
-
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
Throw in something about dangling pointers.
-
Nullable or Not. That is the question. Are they good or are they bad? What are YOUR thoughts?
Well, they're low in fat, sodium, and carbohydrates, and contain no alcohol; how can that be good? :confused:
-
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...You just ruined an otherwise pointless thread with serious commentary. Get with the program.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 -
Throw in something about dangling pointers.
What about "raising" an exception?
Software Zen:
delete this;
-
MS access users are violated.
The European Way of War: Blow your own continent up. The American Way of War: Go over and help them.
MS Access users are should be violated. - ftfy
Software Zen:
delete this;
-
You just ruined an otherwise pointless thread with serious commentary. Get with the program.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001NOW who's the outlaw? :laugh:
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...