- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
The INDICATOR is part of Standard SQL and has been used for decades when SQL is embedded in a X3J language. Doesn't anyone read the manuals any more?
Admin
Admin
How about QuantumStateNullableValue, wich state is null or not null, but only when you read it.
Admin
Admin
This isn't even a WTF at all. As other people have pointed out, it's just a confusion of terms -- the programmer obviously meant "IsZero" and "IsVeryZero". Since "zero" translates as "null" in several languages, this is perfectly reasonable.
There is no way that anybody would write that sort of code if they really meant to create nullable types (in the object/pointer/database sense).
Admin
Cannot stat '/dev/verynull'. Looks like I need to upgrade my kernel.
Admin
http://en.wikipedia.org/wiki/Null_%28computer%29
Hmmm ...
'So, for any A, the expressions "A = Null" and "A <> Null" are neither true nor false.'
Admin
the real WTF is that NULL means the ABSENCE of any value.
0 is a value a value of ZERO, 0.00000000000001 is a value as well.
Admin
They also forgot...
isLudicrousNull()!!!
Admin
If it is Pretty Null, can there be an UglyNull?
Admin
Here in the bay area we'd probably call that "hellaNull"
Admin
This first of all struck me as a big WTF. But it is of course completely logical given the problems you get with floating-point arithmetic.
Admin
don't forget Ludicrous speed
Admin
"?????? ???!"
Admin
I would like to add something other than a snide remark to the discussion. This WTFery is best consumed at a single glance. Both the concept of IsVeryNull and IsVeryZero are non-sequiturs. Null and Zero in general use are considered to be absolute values. Its not like a temperature or a color which can vary, and make statements like Very Hot and Very Blue sensible. To use a modifier on a single scalar value is what breaks with normal assumptions. What would you think of a weatherman who stated that "Today, the low temperature will be very 20 degrees".
Everyone has their own cutoff or threshold on what they consider a WTF. I'd recommend just enjoying the first reaction you get on this one and then letting it go.
Admin
BAH.
That's SO NOT Enterprisy ...
(hey, that captcha made me think: I'm almost a machine (3 attempts before getting it right)! I wonder if I can pass the Turing test ... huuummm $$$)
Admin
Admin
Like "Weird Al"'s line in the lyrics for Fat: "When I sit around the house I really sit around the house". This line is in the background vocals, and I had a real rough time hearing them. Yeah, I'm a non-native speaker, so there.
Admin
No one also seems to want to mention obvious Very Bad Puns, such as
isSecondGunmanOnTheGrassyNull();
--
$0.02
Admin
I fully agree.
Admin
Once again: I fully agree.
Admin
I believe I missed the joke here, but no NULL is equal to any other NULL, including itself.
Admin
Not correct. isNull(NULL,NULL) returns true.
In fact, isVeryNull(NULL,NULL) returns true too.
So not only NULL is equal to NULL but it is very equal ;)
Admin
Just a quick correction: C++ isn't a strongly typed language; it's weakly typed.
Also, the correct method in Java to represent null values should be to use the class that corresponds to the primtive value (such as the Integer class). I'm not sure whether this is the most common method, but it should be.
Admin
Yanks eh? They did it again.
Admin
OK, what's up with the gimps saying "OMG you've got it all wrong, they meant ZERO not NULL!!"? How does that make it any better? How is "zero and very zero" different to "null and very null"?
When you are talking about absolute values (be it null, zero, seven, true, false, or FileNotFound), there is no "very". It either is, or it isn't.
If it's zero.... it's zero! No margin for error there at all. Having "isCloseToZero" and "isVeryCloseToZero" would be the terms to use in that instance, but even that is horrible. We're talking about floating point maths here, with numbers up to hundreds of digits long, and in that context , 65 is "close to zero".
"isSmallerThanAMillionth" and "isSmallerThanAHundredth" would be more accurate, and clearer - it at least means something. How can anyone reading "isZero" know that it also includes non-zero numbers, and the difference between that and "isVeryZero"? Code obfuscation at its best.
Summary: Stop saying "it's ok, they meant zero" - meaning zero here would be just as big of a WTF as meaning null!
Admin
Hmm .. i prefer the VERY elegant steakhouse ...
Admin
Oh shit, thanks for the advice - that's where we've been going wrong. Dump C++ and rewrite our enterprise apps as strongly-typed .BAT files.
The master has spoken. He decree the One Way to all.
Admin
This is not howlingly bad code. The only real WTF is in the naming. These functions don't check database nulls, they check aproximately-equal-to-zero, and so should be named
isNearlyZero and isVeryNearlyZero
That and the magic numbers that should be constants.
That and the idea that someone is actually representing DB nulls this way
That and not using a library function to check float-equivance.
It's not as bad as Delphi code that I saw a colleage working on yesterday - and I quote:
if StrToFloat(trim(Format('%15.2f', [fooFactor]))) = 100.00 then
That's right folks - he's printing it into a string with a two-decimal place rounding, then converting that back into a float, just in order to do what a the standard library can do:
if Math.SameValue(fooFactor, 100, 0.01) then
Gah.
Admin
I don't have a particular problem with non-nullable value types, but the DateTime thing did weird me out somewhat. We were using DateTime.MinValue as a "null" constant, which led to interesting problems interoperating with Java. In the end it was easiest to set up a constant GregorianCalendar value in a static initialiser block (nullDate.setTimeInMillis(-62135596800000L);, for those who are interested :)) as NULL_DATE in the Java system...
Admin
And they would then be VeryWTF?
Admin
Leave that to the politicians...
Admin
I didn't read all of the posts, but what about "isAbsoluteNull()" ?
Try to top ;)
lg,
Toni
Admin
Forty-Two
Admin
This is just bad naming, not truly WTF. They clearly meant this to be a "close to zero" check, not something that was conceptually "null" in the usual sense. Anything making use of floating point operations is peppered with tests like this.
-Adam
Admin
Oops you're wrong. Null != Null
[8o|]
Admin
According to SQL, he is, but according to about-any-programming-language...
Admin
Did you know that in S60, null is just a bit less than MuchLess?-)
enum TThreadPriority
{
EPriorityNull=(-30),
EPriorityMuchLess=(-20),
EPriorityLess=(-10),
EPriorityNormal=0,
EPriorityMore=10,
EPriorityMuchMore=20,
EPriorityRealTime=30,
EPriorityAbsoluteVeryLow=100,
EPriorityAbsoluteLow=200,
EPriorityAbsoluteBackground=300,
EPriorityAbsoluteForeground=400,
EPriorityAbsoluteHigh=500
}
Admin
HL7 defines 10 flavors of null, which is an incomplete list, IMHO, since they leave out isVeryNull and SortaNull:
Mr Dooku
Admin
Expressing an innocent opinion, while unknowing, about a post is one thing. Preaching to others about their wrong ways, while not having any idea wtf you're talking about, is another.
I don't know who would get the "daily moron" award for the most "promote-to-management" incompetent reply, you or the guys who mention "data base" or "nullable types" in their replies.
For your information, one can say 65 equals 0, once my threshold is high enough. Think of it as 65 == 0 for high enough values of zero.
I would love to see a real C++ high performance application writing wtf here, and witness the folks on the forum wondering about where are the nullable types or how many database hits it takes to run a 3d graphics engine...
THEY MEANT CLOSE TO ZERO, OK?
cheers,
Devildog
Admin
RayS:
Expressing an innocent opinion, while unknowing, about a post is one thing. Preaching to others about their wrong ways, while not having any idea wtf you're talking about, is another.
I don't know who would get the "daily moron" award for the most "promote-to-management" incompetent reply, you or the guys who mention "data base" or "nullable types" in their replies.
For your information, one can say 65 equals 0, once my threshold is high enough. Think of it as 65 == 0 for high enough values of zero.
I would love to see a real C++ high performance application writing wtf here, and witness the folks on the forum wondering about where are the nullable types or how many database hits it takes to run a 3d graphics engine...
THEY MEANT CLOSE TO ZERO, OK?
cheers,
Devildog
Admin
Surely those who didn't go to the party would not have a corresponding tuple in 'went to the party' relation. If they didn’t go the party, they didn’t go to the party, period. Null alcohol units would end up in the proposition<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
The person named p, arrived at the party at time t and drank an unknown number of beers. <o:p></o:p>
Your meaning is of Null beers drank is.<o:p></o:p>
The person named p never went to the party because of some magic value in one of the attributes. <o:p></o:p>
Anyhow, the specific meaning of a SQL Null is a SQL DBMS is ‘unknown’. <o:p></o:p>
Admin
as mentioned above: wrapping the primitive type in a class,
the Nullable types in .NET are a class, wrapped around a primitive, with a flag for Null, and some member functions for dealing with null and default values (eg .getValueOrDefault).
Admin
0 is a value, not the same as NULL
NULL should mean "no one has touched this and we have no idea what the value should be"
Admin
schools teach a lot of things that people don't pick up on. Grammar, math, etc...
NaN !~ Null !~ 0
NaN you'll see on variant types that can represent numbers OR other values. NaN may not be a number but CAN be a string, object, etc....which do have meaning.
0 has meaning
Null is the primordial void, no interpretable value except "I dunno" or possibly "not applicable" in the case of FKs.
I cringe anytime someone doesn't see the difference between NULL and 0.
Admin
Well, no.. As mentioned beforehand, in the context of SQL (assuming this is the context we are talking in), it means 'Unknown'. (It’s a rather poor way of dealing with unknown data,, but that's a whole WTF and digression we can do without). <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
Someone could have touched it. 'We have no idea what the value should be' is correct; 'no one has touched this ' is however is not because we may have thought we did know the value, but then found out that we didn't really know the value at all. <o:p></o:p>
Admin
Depending on the particular application, you may need to differentiate between "having a value of zero" and "having no value set at all". Kinda like Schroedinger's Cat, where a NULL value means the cat is neither alive (1) nor dead (0). Say you have a remote weather monitor app and are filling an array with readings from a radio linked temperature probe that potentially outputs a value between 100 and -100. In the case where the radio link is broken you certainly don't want to use "0" to indicate that, as 0 is a valid temperature. Instead you'd use a NULL value, so that when you later pull data from the array you know the difference between "cold" and "broken".
Admin
This is the best post here, thats all it would have took.
Presumably not a yank eh?
Admin
That's because your kernel isn't Enterprisey (and assuming your kernel isn't Enterprisey, you aren't Enterprisey either... So you'll be anchored to your programmer work for your entire life, and you will never ever become a Software Designer).
Cheers!
Guido
Admin
The whole "Null" or "VeryNull" reminds me of Microsoft's own MSI Install logs--there is an entry near the bottom of most of them that will alternately say
Reboot=Supresss
or
Reboot=ReallySupress
Not sure what the difference is...
--Jim