| « Prev | Page 1 | Page 2 | Next » |
Re: Not the Most Thought Out Enumeration
2007-07-13 09:35
•
by
AdT
(unregistered)
|
|
|
|
Cue the YesNoFileNotFound permutations.
|
Re: Not the Most Thought Out Enumeration
2007-07-13 09:36
•
by
Gerald
(unregistered)
|
|
substract 1 and take the absolute. then suddenly the values are the right way round
|
Re: Not the Most Thought Out Enumeration
2007-07-13 09:36
•
by
ozangunceler
(unregistered)
|
|
Man! What were they thinking ?
|
Re: Not the Most Thought Out Enumeration
2007-07-13 09:39
•
by
Tobs3n
(unregistered)
|
|
haha..."Do you think your enumeration is sane?" NOT!
|
Re: Not the Most Thought Out Enumeration
2007-07-13 09:40
•
by
Bad Taste
(unregistered)
|
|
Was this coded by someone who believed that when she says 'No!' that it really means 'Yes!'?
|
Re: Not the Most Thought Out Enumeration
2007-07-13 09:41
•
by
TexDex
(unregistered)
|
|
It sounds as if the person who wrote that perhaps spoke English as a second language. For native English speakers the instinctive opposite of "Yes" is "No", but others may easily make the mistake, especially if their native language isn't closely equivalent. For example, I'm horrible at remembering the genders of German nouns.
Working at an e-commerce company that farms a little bit of the dev work out to India, I see things like this occasionally. Once I saw a variable "boolean allowGiftWrape". |
|
Hey, why the link in the first reply go to yahoo to get to wikipedia?
|
Re: Not the Most Thought Out Enumeration
2007-07-13 10:13
•
by
Simon
(unregistered)
|
|
It's opposite day!
|
|
Two things immediately leapt to my mind when I read about the debugger:
1. In the Bourne shell, an exit code of 0 indicates success, and any other indicates an error. Sensibly, the boolean logic of the shell uses 0 as true and any other value as false. 2. The fact that your debugger displays the enum values as numbers, thus making it hard for you to understand what they mean, is the fault of the debugger, or perhaps the programming language; not of the programmer who wrote the program. The code is still insane, though. |
Re: Not the Most Thought Out Enumeration
2007-07-13 10:31
•
by
/b/
(unregistered)
|
|
i still like BoolPlus best:
Yes, No, Perhaps |
Re: Not the Most Thought Out Enumeration
2007-07-13 10:33
•
by
rbowes
|
1. Only if the question is, "was it successful?" and not "what's the error code?" 2. Perhaps it isn't compiled with symbols for whatever reason. |
Re: Not the Most Thought Out Enumeration
2007-07-13 10:34
•
by
XIU
|
I noticed that Google does that too, when you search for something and hover over an url it shows the normal one, but when you copy it it has all this google crap before it. |
Re: Not the Most Thought Out Enumeration
2007-07-13 10:36
•
by
AdT
(unregistered)
|
Because I copied the link from the Yahoo results page. Didn't consider the stupid redirect, sorry. This is the correct link. |
Re: Not the Most Thought Out Enumeration
2007-07-13 10:42
•
by
Mikolaj
(unregistered)
|
|
They should just change the order of enums.
For any well written application it should have absolutely no effect... |
|
Yes means No and Not means Yes. Does this code suck?
|
Re: Not the Most Thought Out Enumeration
2007-07-13 10:50
•
by
poochner
|
As long as it's not a library exposing an ABI. |
Re: Not the Most Thought Out Enumeration
2007-07-13 10:58
•
by
T$
(unregistered)
|
0 |
Re: Not the Most Thought Out Enumeration
2007-07-13 11:04
•
by
Anonymous Coward
(unregistered)
|
Here (in Germany, at University) i maintain an application that has database fields "firstname" and "sirname". Maybe a simple typo, but could be a lack of understanding also. |
Re: Not the Most Thought Out Enumeration
2007-07-13 11:14
•
by
Mikoangelo
|
Yes, it is. |
Re: Not the Most Thought Out Enumeration
2007-07-13 11:23
•
by
T$
(unregistered)
|
No it isn't. Now who's telling the truth, me or Mikoangelo? |
Re: Not the Most Thought Out Enumeration
2007-07-13 11:24
•
by
Sven
(unregistered)
|
X Cancel? |
Re: Not the Most Thought Out Enumeration
2007-07-13 11:31
•
by
whiny wee bastard
(unregistered)
|
Yes, as a non-native speaker of English, I often misplace my W's too. |
|
Some id10t did the same thing in one of our apps. It's still there, complete with a comment by a frustrated subsequent developer:
foreach( ResponseTypeEntity type in _responseTypes) |
Re: Not the Most Thought Out Enumeration
2007-07-13 11:59
•
by
Grant
(unregistered)
|
|
Before I saw that it was C++, I thought maybe 'no' was a keyword.
Like you've never had to use 'klass' instead of class, or 'type_' instead of type. |
|
Borat: This Yes is NOT 0.
captcha: NOT! |
Re: Not the Most Thought Out Enumeration
2007-07-13 12:44
•
by
Gert
(unregistered)
|
|
yeah, along the way you could also multiply with 100 and divide with the square of 10
... or just subtract the int value from 1 |
Re: Not the Most Thought Out Enumeration
2007-07-13 12:50
•
by
Zygo
(unregistered)
|
Mikoangelo, if I remember my logic puzzles correctly... |
Re: Not the Most Thought Out Enumeration
2007-07-13 13:03
•
by
Zygo
(unregistered)
|
Oops, I don't remember it correctly. The puzzle I'm thinking of has a different solution (T$, if I asked Mikoangelo myself, would he say it's opposite day?). In any case, Simon is clearly lying. ;-) |
Re: Not the Most Thought Out Enumeration
2007-07-13 13:07
•
by
Jno
(unregistered)
|
Depends if you are Pukkas, Shilli-Shallas or WottaWoppas. If I was to ask Mikoangelo which tribe he belonged to, what would he say? http://mathforum.org/dr.math/faq/faq.liar.html |
Re: Not the Most Thought Out Enumeration
2007-07-13 13:17
•
by
Jon W
(unregistered)
|
|
That enum is SO missing a "Brillant" entry. Anyway, the enum writer was probably a fan of Waynes World. Which probably tells us the age of the code (or the author). Captcha: "quake". Now where did I put that CD? |
Re: Not the Most Thought Out Enumeration
2007-07-13 13:28
•
by
AnonCoder
(unregistered)
|
|
Yes that code is a horrendous WTF.
The only bigger WTF is that it wasn't immediately refactored the first time someone with a clue saw it. |
Re: Not the Most Thought Out Enumeration
2007-07-13 13:36
•
by
nobody
(unregistered)
|
|
So... anything that is not Yes is TRUE and therefor No, which is the opposite of FALSE, which in turn is Yes?
At least the triple negation works... sorta. |
Re: Not the Most Thought Out Enumeration
2007-07-13 13:59
•
by
savar
|
or.. i = (1-i) |
|
Yes, that is false.
That is not false. What's so hard about it? Especially once you understand these are allowed answers to the following question: "Is it false to say that the value isn't true?" --Rank |
Re: Not the Most Thought Out Enumeration
2007-07-13 14:39
•
by
foxyshadis
|
And then you find out it was serialized to a database. |
Re: Not the Most Thought Out Enumeration
2007-07-13 14:40
•
by
sas
|
|
You're lying if you say it's Opposite Day. You can only say It's NOT Opposite Day!
|
Re: Not the Most Thought Out Enumeration
2007-07-13 15:07
•
by
jjacksonRIAB
(unregistered)
|
Or just subtract from 1 and forget the absolute. :-) |
|
I don't agree with the code, but if they just were enums to a push button response, and they matched the proper one to the proper event, no one would ever know.
|
Re: Not the Most Thought Out Enumeration
2007-07-13 15:38
•
by
shadowman
|
|
This suit is black! Not!
|
Re: Not the Most Thought Out Enumeration
2007-07-13 15:58
•
by
Coyne
(unregistered)
|
Much easier and even more confusing if you subtract from 1: (1 - var) |
Re: Not the Most Thought Out Enumeration
2007-07-13 16:14
•
by
mattmoss
|
I was going to suggest the same, but let's use the enumeration values, shall we? Not - Not => Yes. Not - Yes => Not. Does that mean two wrongs make a right? Hmm... Not + Not => 2 Guess naught. |
Re: Not the Most Thought Out Enumeration
2007-07-13 16:41
•
by
a/c
(unregistered)
|
The WTF is that you're using magic numbers to test the result. You have to remember the inverted logic every time you use it. Chances are you're gonna screw up at least once and it'll cause problems. Defining it as an enum like the original WTF actually makes more sense. |
Re: Not the Most Thought Out Enumeration
2007-07-13 16:43
•
by
Zylon
|
Why would you think it was anything other than a misspelling of "surname"? "U" and "I" are even right next to each other on the keyboard. |
Re: Not the Most Thought Out Enumeration
2007-07-13 17:31
•
by
iMalc
(unregistered)
|
Ah but two right's make a right, right? Yes + Yes => Yes! |
Re: Not the Most Thought Out Enumeration
2007-07-13 18:19
•
by
Cewl
(unregistered)
|
|
Perhaps as a response to the question "Is it false that you want to download or not"?
enum TypeDlYesNo { Yes, Not }; |
Re: Not the Most Thought Out Enumeration
2007-07-13 19:24
•
by
Phyzz
(unregistered)
|
I'll have what that enum is having. |
Re: Not the Most Thought Out Enumeration
2007-07-13 21:44
•
by
FredSaw
|
Would that the original author had done so. This was a fairly large application, involving calls to the database-stored "ResponseTypeId" records from multiple modules, and I was only assigned to correct one simple coding error with it. I assume my frustrated predecessor was assigned no more than that, as well. Let the record show that the original code was outsourced from America to India. I'm sure either of us would have been happy to try to rewrite the application to switch yes=0, no=1 for yes=1,no=0. But that was not our assignment, and so we were doomed--he to leave a disparaging comment in the code, and me to post it on TheDailyWTF (that's still how I think of this website, and what my coffeecup still says). |
Re: Not the Most Thought Out Enumeration
2007-07-14 06:27
•
by
sergio
(unregistered)
|
As well as a lot of functions in libc. Just have to get used to it. |
Re: Not the Most Thought Out Enumeration
2007-07-14 07:19
•
by
DrawFire
(unregistered)
|
|
Or just subtract from 1
|
| « Prev | Page 1 | Page 2 | Next » |