- 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
Frist? or Frist fail?
Admin
By the way, DBNULL is lacking the 'file not found'.
Admin
The only Frist NON-fail is an actual comment about the article.
Admin
Grilliant. That will gave a few gytes in the gatabase!
Admin
The word you're looking for is "Grist".
Admin
Gonvert to gomment.
Admin
So, TRWTF is that there's a website out there that's just pictures of a generic brands that I guess is supposed to be funny?
Admin
Admin
Admin
What a silly gunt.
Admin
The real WTF is Visual Gasic.
Admin
So.. other than the Gontractor not being able to write "Convert" correctly (which reminds of my predeccessor at work who always wrote "languarge")... where is the wtf?
Admin
Am I reading the integer check right? Does it actually check twice to see if the value equals Integer.MinValue? I guess when you need to be double sure of its value.
Admin
So GonverttoDBNULL is the same as ConvertToBoolean? Because it doesn't look like it is checking to see if we can convert to dbnull. So not only is Gonvert almost equal to Convert, in Maryland, but DBNULL = Boolean.
No wonder my code never worked up there.
Admin
I noticed that too. Perhaps it's because they were worried that the value might change between the first check and the second check.
[More likely they meant to check for MinValue and MaxValue and apparently couldn't even get that right.
Admin
The funny part is the people that spend extra money for the name brand when it the same damn stuff in the box.
Admin
Gottle of Gear.
Admin
The word I'm looking for I can't say because there are preschool programmers present.
Admin
You mean, despite the fact that he convert from Boolean to Boolean in the first function, checks if myValue equals Int.MinValue twice in the second, compares with both empty strings and string.Empty in the third and compares dates converting them to string in the fourth?
Admin
Illiteracy (and the lack of code comprehensibility and maintainability that come with it) isn't enough of a WTF for you?
How about a programming language that doesn't short-circuit boolean 'OR' evaluation unless you use an operator called "OrElse"?
Admin
Admin
GIRST which is better than FIRST!!!!
See, I won't defend VisualBasic but for some reason, the most lame programmers end up using it and hence it ends up here.
Admin
I hope you're joking (so many things wrong with this code) but if you're not:
Admin
Made in Bangalore??
Admin
This code gave me Conorrhea.
Admin
If there's anything I have learned in this business, it is to never say never. Sometimes one has to check his arrogance at the door, and write code to check for a condition that he is "certain" can never occur.
Admin
Exactly, because we never see any java, or PHP, or C#, or... whatever you are using...
Admin
Okay, everyone. Do the needful.
Admin
No, Galcutta.
Admin
IsNothing() is the VB test for "== null". So it's even better than you thought, because first he tests the value (which will fail if the input is null) and then he tests to see if the input is null.
...which makes the IsNothing() test as valueless as the rest of this grummy gode.
Admin
Grap - someone beat me to the Monty Python reference
Admin
The list of things wrong with this code is longer than the actual code.
I understand your point, but it doesn't make sense to convert a date to a string to validate it anyway. Especially when ToString is culture-sensitive and might yield different results in different contexts.
Admin
Not sure if trolling, or saying that you should check if the string is null before checking if it is empty....
Admin
Almost all of these are language specific WTFs, so everyone not into that language that much will only get the illiteracy here.
And to answer the other question: No, that alone is not a WTF. I see code of people that are unable to write proper (or even halfway proper) English far too often to be bothered by that anymore.
Admin
No, Hyderabad...
My first thought looking at this is that it is Welsh, and we have the standard mutation creeping in.
Admin
.NET dates are primitives that don't support null values. The date check should probably be "myDate = Date.MinValue"
Admin
Admin
Zero is not Null!
Admin
"gontractor" is probably an apt name.
You hire them, they do crappy work, foist it on you, and then they're gone.
Admin
It's actually the "if blah==7 return true else return false" that really grates for me ... WTF not "return blah==7"? Someone being paid by the line?
(OK, I suppose it might just come in handy one day to set a breakpoint on the exceptional case where some check is returning false and your debugger doesn't do conditional breakpoints, but still..)
Admin
Admin
Maybe he uses a speech to text thingy and it isn't his fauld begause he has a gold.
The "if test then return true else return false" stuff probably appeared when he blew his nose.
Admin
Admin
You don't know that; someone may have redefined String.Empty.
Admin
Fair point, but if you're validating a date from a date value, cultural sensitivity is irrelevant, since the item's life cycle is limited strictly to the validation routine.
Admin
Private Function GonvertToDBNULL(ByVal myValue As Boolean) As Boolean If myValue Then Return True Else Return False End If End Function
This is the one that gets me. Assuming the function is to determine with the value should save DBNull, or the value itself, this makes no sense. The database saves boolean values as either false for false, or null for true.
Admin
In Germany, everyone knows if someone says "gonvert" or "gomment", they come from Saxony.
Admin
The function names indicate that it will convert the value to null, but they reuen booleans.
So, are they checking the passed in value to see if they can be converted to null for saving to the database?
If so, why can a boolean value of True convert to null?
Captcha: inhibeo. A Harry Potter spell.
Admin
Also, 0 and the minimum integer value aren't the same. What if a field should actually store the minimum integer value? You won't know what the value was supposed to be.
And sometimes Or is used and sometimes OrElse is used. WTF.
Admin
You say fail and then repeat what he said. Or is equivalent to |, neither one short circuits. OrElse is equivalent to ||, both short circuit. The fact that OrElse is generally used more often than Or and is longer/looks odd is inconvenient, but having two different or operators with different rules is entirely reasonable.