|
|
|
| Non-WTF Job: C++ Developer at Good Grievance (Ronkonkoma, NY) |
| « Prev | Page 1 | Page 2 | Page 3 | Next » |
|
Fist!
|
|
Secodn!
|
|
HUUUUUUUUURF
|
looks to me like someone needed a breakpoint while debuggering |
|
25th! (space)
No, I didn't count. Had the computer do it for me. WTF? |
looks to me like someone had no clue what he was doing!!! |
Re: A Smorgasbord of Classics
2008-09-05 08:31
•
by
A Nonny Mouse
|
"twenty" is obviously base 12.5 |
Brought to you by the same folks who came up with FileNotFound? |
Re: A Smorgasbord of Classics
2008-09-05 08:35
•
by
jimlangrunner
|
Bah. for breakpoints, i=i has always struck me as easy. but then, so am I. |
Re: A Smorgasbord of Classics
2008-09-05 08:36
•
by
Customer Service
(unregistered)
|
|
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: private final static String twentyspaces = " "; The customer is always right! |
Holy bejesus that's funny |
Re: A Smorgasbord of Classics
2008-09-05 08:55
•
by
Stephen Bayer
(unregistered)
|
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 |
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. |
Re: A Smorgasbord of Classics
2008-09-05 09:00
•
by
MiffTheFox
|
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. |
Re: A Smorgasbord of Classics
2008-09-05 09:05
•
by
NiceWTF
(unregistered)
|
Brought to you by strcmp() and friends, more likely. |
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) |
|
if(isGoodComment || !isGoodComment)
{ postComment(); } |
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. |
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. |
#define ZERO -1Remember that? I took a second look at the code, and it turns out I was wrong. Here's how it actually reads: #define NEGATIVE_ONE 0 |
lSend = IIf(lSend = True, True, False) 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. |
A conditional breakpoint, in a debugger that doesn't support them. |
That's not the wtf, the wtf is that it's exactly the same comparison twice. |
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. |
Re: A Smorgasbord of Classics
2008-09-05 09:25
•
by
---
(unregistered)
|
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). |
Re: A Smorgasbord of Classics
2008-09-05 09:25
•
by
n0t 1337 h4xx0r
(unregistered)
|
|
#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!"; |
|
comparisment?
|
|
If (Mid(CStr(cppObject.GetValue()), 1, 1) = "-") Then ...
Silly old bear, the programmer should have used Left rather than Mid. Saves a few keystrokes. ;) |
Re: A Smorgasbord of Classics
2008-09-05 09:36
•
by
Hope that helps
(unregistered)
|
Comparisment is used to avoid embarrison. |
|
It wasn't a bug after all...
|
A number base (a.k.a. radix) does not need to be a whole number; that just makes it easier to work with. The Unix DC program (or at least the dc.sed version) supports fractional input and output radixes, via the 'i' and 'o' commands. Type 12.5;i;20;p; (replacing ; with newlines), and it'll print 25. Take the input number 20, expand it to 2*(12.5**1)+0*(12.5**0), and you get 25. If dc has a fractional output base, it's forced to spell out each "digit" as a decimal number, separating the "digits" with spaces. For example, 3.4;o;20;p; yields 1 1.6 3.0, since 1*(3.4**2)+1.6*(3.4**1)+3*(3.4**0) = 20. |
|
Ah, someone beat me to it. Comparisment is a word now?
|
Re: A Smorgasbord of Classics
2008-09-05 09:44
•
by
Someone You Know
|
And a perfectly cromulent one at that. |
|
if (connected || !connected)
{ return file_not_found; } |
Re: A Smorgasbord of Classics
2008-09-05 09:45
•
by
Hope that helps
(unregistered)
|
http://www.comparisment.com/ is a registered domain, so the word must be in some dictionary somewhere! |
|
** 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 |
|
** 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 |
|
** 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 |
|
lol, web squatters.
|
Re: A Smorgasbord of Classics
2008-09-05 09:52
•
by
Satanicpuppy
|
|
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; |
Re: A Smorgasbord of Classics
2008-09-05 09:55
•
by
Paul Carpenter
(unregistered)
|
The source for the game Power Sports Soccer had something similar, along with #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... |
Re: A Smorgasbord of Classics
2008-09-05 09:59
•
by
Kuba
(unregistered)
|
That's why I have always been at loss why some standard C header is not forced to include something to the effect of #define NOP() asm("nop");I have a header in my library of "useful stuff" that does include this. It is quite cross-platform, too!
Cheers, Kuba |
|
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!
|
He just doesn't want the code to run if connected = FileNotFound |
Re: A Smorgasbord of Classics
2008-09-05 10:33
•
by
rosko
(unregistered)
|
Or you could just use CBool(lSend) |
|
javascript:alert(" ".length);
|
Re: A Smorgasbord of Classics
2008-09-05 10:48
•
by
moz
(unregistered)
|
I wonder why it chooses to print that "number", rather than 121.2. |
|
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. |
| « Prev | Page 1 | Page 2 | Page 3 | Next » |