- 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
Meant to quote this.
Admin
Ghat Ghe Guck????
Admin
"OrElse" sounds a great command for avoiding that double minValue check...
myValue = 94 if myValue = Integer.MinValue Or myValue = Integer.MinValue... //Just to make sure
myValue = 94 OrElse! if myValue = Integer.MinValue... //Computer will be intimidated into setting the value properly
Admin
Not intending to troll, no. And you are right, that is exactly what I meant, because the way the gode is written, if IsNothing() were true, the gode would fail before it ever tested that condition.
(...gondition?)
Admin
He was bitten by a siamese gat.
Admin
Admin
TRWTF is VB.Net
Admin
I used to raise goats. They bite. They also butt and kick. Also, unfixed males smell really goaty, and they reproduce like rabbits.
Admin
Or possibly Galgutta.
Admin
FTFY
Admin
http://forums.thedailywtf.com/forums/thread/284561.aspx
offcourse you do!
Admin
Admin
Although I have seen anecdotal evidence and heard rumors, this is the most compelling evidence of the existence of the Dept of Redundancy Department.
Admin
Where is Gotye when you need somegody that you used to gnaw?
Admin
Cuz its gone daddy gone, The love is gone. Cuz its gone daddy gone, The love is gone. Cuz its gone daddy gone, The love is gone. Cuz its gone daddy gone, The love is gone away.
Admin
You win!
Admin
This is worse than the motor datasheet I read today that repeatedly referred to the "termistor" and associated "termal switch."
Admin
I would chalk that up to consistancy. Since they are creating a function for all types one for boolean just makes it easy to call the same function in all locations and not have to worry if the value is already a boolean.
Admin
Just don't turn up on the US border and, when asked what your profession is, answer "Terapist".
Admin
This post made me gappy so I decided to gomment this.
Admin
Admin
Admin
You should definitely watch Vidya Balan's Kahani picture. It is amazing storyline and very well worth watching.
Admin
Please use your brains before posting here....
It's clear that the purpose of the functions is to determine if the respective variables' values are sort of "neutral". And if they're "neutral", the functions should return TRUE.
Yes, the code contains a lot of WTF's, but so do many of the comments added. And I don't really get why they wanna check this, but the code has been taken out of context.
The biggest WTF, though, is those self-righteous jerks saying "TRWTF is VB.NET" or "C#" or "VB" or "JavaScript" or whatever. Don't you get that different languages are good for different tasks and different people? It's like saying "I think sports cars suck because they cannot pull a 10 ton trailer". I'd never be able to teach my 70-year old dad C++, but I'd easily teach hime some basics (pun intended) in VBScript.
And to all those of you complaining about the Or-vs-OrElse-difference, saying that the programming language should short-circuit boolean evaluation all the time. Check this:
Admin
exagtly what i was looging for
Admin
Admin
What, nobody posted this yet?
dilbert.com
Akismet, no, this is not spam!
Admin
Stop generalizing you dickhead!
Admin
Umm ... VB "or" doesn't do short-circuiting. Java "|" doesn't do short-circuiting. VB "orelse" does do short-circuiting. Java ""||" does do short-circuiting. So where is the fail on equivalence?
Admin
Well, if by "language specific" you mean that someone who doesn't know VB could not possibly be expected to figure out that "end if" probably marks the end of an if/then/else block, or that "or" might mean to perform a logical OR in a test, then I guess in that sense you could say that most of these are language-specific. But assuming someone with a reasonable knowledge of programming who can make plausible guesses about what a block of code in an unfamiliar language might do:
The only language that that's specific to is English.
Surely you can figure out what that function is doing without knowing VB. Not language specific.
Okay, that's language specific. One can certainly imagine a language where the "integer" data type can hold a null.
Not language specific. Even if you can't guess what "Integer.MinValue" is, you can readily see that it is doing the same test twice.
Language-specific. You might reasonably guess that String.empty=="", but you couldn't be sure there isn't some technical distinction without knowing VB. (Personally I don't see why String.empty exists. "" is unambiguous and less to type. But I digress ...)
Language-specific.
Debateable. I'd certainly be cautious about converting a date to a string to compare to a specific value in any language: Not only does this assume that there are no I18N issues, but you set yourself up for subtle errors, like are numbers padded, and if so are they padded with spaces or zeros? You could have a comparison that looks right but fails because the string conversion creates "am" but you wrote "AM", etc.
language-specific
not language specific
So I count 4 language-specific, 4 not language-specific, and one debateable.
Admin
Yeah, that one always gets me, too. Especially in this case, where the first one simplifies down to "return blah".
I just came across a line of VB recently that read -- oh, I should explain for those not familiar with VB, the "iif" function tests it's first argument, and if it's true returns the second argument and if false returns the third, so iif(blah, a, b) returns a if blah is true and b if blah is false, where blah can be an expression. Like ?/: in Java. So anyway, I saw a line of VB that read:
(I forget the exact expression.) So if it's true, he sets true, and if it's false, he sets false. Umm, why did he need the iif?
Admin
We used to have a guy that would never change something once he'd typed it in. If the variable started out as an index, but changed later on into a count-of-the-remaining-items, he wouldn't change the name. His rationale was that such changes could introduce errors, and the computer didn't care one way or the other what name was used.
I also noticed that, walking out of a meeting with an empty soda can, he'd throw it in the trash bin, when the blue recycle bin was right next to it.
Of course, I was the guy staying at work until 2AM some mornings, cleaning up in his wake.
Admin
You made me hurt myself!
Admin
He must be dyslexic.
Admin
The real WTF is that he should be writing in G, G++ or G#
Admin
Was the contractor from Finland? The difference between sounded and unsounded consonants seems to be difficult for the people with the native finnish language.