- 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
Fist!
Admin
Secodn!
Admin
Turd!
Admin
Thrd!
Admin
HUUUUUUUUURF
Admin
Admin
25th! (space)
No, I didn't count. Had the computer do it for me.
WTF?
Admin
looks to me like someone had no clue what he was doing!!!
Admin
Admin
Admin
Bah. for breakpoints, i=i has always struck me as easy. but then, so am I.
Admin
Customer requirement one: The date must appear in columns 1 thru 10.
Customer requirement two: The product description (45 characters) must be right justified to column 80.
Customer requirement three: There must be twenty spaces between the date and the product description.
Solution:
The customer is always right!
Admin
Holy bejesus that's funny
Admin
I was under the impression that bases needed to be whole numbers over 1.. ie. base 2, base 3, base 4, base 5, ... ok.. this could go on for a while.. i think there are a lot more whole numbers over 1. I used to use random bases when doing my fourth grade math homework, then argue with the teacher about the validity of my answers, calling her an idiot for not agreeing with me that 8 + 5 = 11
Admin
This comparison order is actually an old trick to avoid unintentional assignment in if() clause from the days when IDEs/compilers didn't warn about those. Constant = Variable assignment resulted in compiler error and saved some debugging time.
Admin
Okay, thanks for sharing with us what a base is... The point of the joke is that the twentyspaces variable is actually 25 spaces. 20 in "base 12.15" here is equal to 25 base 10.
If anything, you're the idiot for assuming base 12 on a fourth-grade level problem.
Admin
Brought to you by strcmp() and friends, more likely.
Admin
As far is I know VB6, lSend doesn't have to be a boolean, ie it can be a Variant. So it could contain other values then true or false. For example, null when read from a db.
This is an ok trick to get a true/false only (boolean)
Admin
if(isGoodComment || !isGoodComment) { postComment(); }
Admin
I was under the impression that everyone who reads here has at least enough intelligence and sense of humor to recognize a joke and therefore not feel the need to correct it. Apparently, I was wrong.
Thanks for correcting my misunderstanding.
Admin
Wow. You'd be really smart if:
a) You didn't state the obvious.
b) You realized that the actual WTF wasn't the constant/variable order, but the fact that the same identical comparison was made twice using an OR.
Thanks for playing, though.
Admin
Admin
Obviously because there are other values than True and False. (FileNotFound etc.)
In a real language I'd just have done lSend = !!lSend; for it, concise way to force a value to boolean.
Admin
Admin
Admin
If you do a lot of batch processing, it's only a matter of time until you write one like this. You'll get an error about 3/4 way through a large dataset and want to step through the code to find it, and so you write a no-op snippet like that so you can set a break point when it reaches the record that's causing the problem. But that could should never make it to production.
Admin
Yeah I've done that. I think conditional breakpoints were there, but made everything run so slowly it was basically unusable (it was on a PS2 compiler I think).
Admin
#define false 1 #define true 0
I've seen such a construction hidden deep inside some header... There was a comment: "Happy debugging, d*ckhead!";
Admin
comparisment?
Admin
If (Mid(CStr(cppObject.GetValue()), 1, 1) = "-") Then ...
Silly old bear, the programmer should have used Left rather than Mid. Saves a few keystrokes. ;)
Admin
Admin
It wasn't a bug after all...
Admin
Admin
Ah, someone beat me to it. Comparisment is a word now?
Admin
And a perfectly cromulent one at that.
Admin
if (connected || !connected) { return file_not_found; }
Admin
Admin
** the following code is neither recyclable or reusable ** but rather highly radioactive toxic sludge ** liable to give you hemmorragic brain damage and anal leakage of the mouth
Admin
** the following code is neither recyclable or reusable ** but rather highly radioactive toxic sludge ** liable to give you hemmorragic brain damage and anal leakage of the mouth
Admin
** the following code is neither recyclable or reusable ** but rather highly radioactive toxic sludge ** liable to give you hemmorragic brain damage and anal leakage of the mouth
Admin
lol, web squatters.
Admin
Some of the conditional stuff I can see; you write it, you change it, you write it, you change it, you write it and FINALLY the data matches what it's supposed to and you don't recheck.
The "20 spaces" I understand as well, though you should never ever ever do that. On old COBOL systems you have a lot of "Fixed Width" flat table databases, and huge chunks of spaces are actually really necessary for running through those, though I'm sure everyone here understands that you should never use more than 1 space at a time to avoid counting errors, and indeed, that more than 1 space isn't useful except in really ugly constructions like:
$line = $valueA.twentySpaces.$valueC.$twentyTwospaces.$valueC;
Admin
#define BEGIN { #define END } #define FOR for #define IF if #define THEN { #define ELSE } else { #define ENDIF }
There was an include file with about 30 more nuggets like that in it...
Admin
Cheers, Kuba
Admin
The company that I work for has an internal application for product / stock management written in VBScript... And, as you can see here, they have great security.
or
They also have great version control, including inline changelogs!
Admin
Admin
Admin
javascript:alert(" ".length);
Admin
Admin
Regarding the final item, a number of years ago I had a discussion over a few Tsing Taos with some VMS weenies (er, hackers) about the proper values for true and false. Their contention was that since in VMS a return value of zero indicates success and any other value returned indicates failure of a function or operation, it makes sense that 1 (or any nonzero value) should be interpreted as false and only 0 be interpreted as true.
They considered the C language's use of 0 as a false value to be a significant wart on the language.
I can say that after many Tsing Taos and several servings of Kung Pao Death I was inclined to agree.