- 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
Obviously the real WTF is that the developer used the word list directly rather than using it as a training corpus for a naïve bayes classifier.
Admin
I think it is a pity they did not use some self learning routine that can handle any type of input from users...Tsk tsk tsk amateurs:
sys> Are your sure? user> Maybe sys? Is that the same as yes?
Now the only thing to do is to come up with a way to get the system to understand affirmatives in the second question and save them under the SET of "YES" strings or "NO" Strings....hmmm...perhaps if I recursively check with the original IF statement....
wait...
Admin
the real wtf is: why does the user need to answer y/n questions via text input?
who needs console apps o_0
Admin
If you ask a pirate something and they don't want to answer something meaning "yes", you get stabbed.
Admin
I think it's "Nay", as in "Yea or Nay".
Admin
The current version may be a bit loose on user behavior, but they are planning to add some AI to the next version. That way the program can accept any user input and learn what it means and how to react.
It seems like a lot of unnecessary complication but the gain in user-friendliness will be quite impressive. Imagine a pirate using this program then: "Are you sure?" "Yar" Then the program answers accordingly: "Ahoy, mate"
The possibilities are endless.
Admin
Sadly, the company I work for has people that would delight in finding which yes answer wasn't allowed so that they could submit a troubleticket, so some of our code has similarly screwy compilations of possibilities.
Admin
[quote user="cconroy"][quote user="TakeASeatOverThere"] What's Pirate for "no"? "Nar"?[/quote]
Nay, but I have yet to meet a pirate that takes no for an answer.
Admin
Bug #324982792
Problem:
While saving, it asked me if I wanted to overwrite the old file, I nodded at screen but question stayed frozen on the screen.
I tried shaking my head but it didn't close!
I need this fixed straight away so that I can return to the document.
Severity: Immediate Fix Required
How to reproduce this bug: Colleagues have confirmed that the dialog box freezes when they nod as well.
Notes: My web cam definitely works, I used it this morning. I have confirmed it is plugged in via MSN.
Admin
I think this was a console app.
For a second, I thought this article was based off of code that I wrote. I, too, have written a class called UserInput that does something similar in this readConfirmation() method. I'm pretty sure I put all the valid responses in a Set, though, and I'm also pretty sure I limited it to just "y" and "yes".
Now, if you excuse me, I need to go add "yar" to the Set...
Admin
Why type "yes" when you can just hit "y" I've just tripled my productivity.
Admin
Could be some kind of joke that is running around the office and no one was able to kill it yet. During the good old startup times we had a lot of those were when reviewing code you found a stupid code section like this one you just extended it.
Some things aren't done because someone thought they make sense but because someone knew they didn't.
Admin
Two problems.
First, the very first thing listed isn't "Y". It's "y". They're not the same.
Second, after looking at the code, you "assumed" there was a cast of 'answer' to lowercase as the first thing it does. Given the quality of the code submitted, this is a ridiculous assumption.
The programmer's first mistake. He should have not added anything, but simply checked the first letter for "Y" or "y" and ignored the request.
Programmer's second (and worse) mistake. OK is not an acceptable answer to a Yes/No question. It's as unacceptable as a question in a dialog (actually used by a former developer here - thank God she's gone):
Are you sure you want to continue?
[Yes] [Ok] [Abort] [Cancel]
Now the programmer continues to be more of an idiot than the user he's dealing with. Third mistake.
OK. I won't argue with the last sentence above. <g> I wouldn't do it myself, as I know I'd have to maintain it and have to deal with other stupid user requests if I let them get away with something like this, but what you[/] do is [b]your problem.
Admin
What about True, False, and of course our good friend "File not found"?
Admin
If you want it to be fast, gotta use some form of sorting. A binary tree or trie would be good.
Admin
Well, I did not assume anything about case conversion, thus my "Try and hit 'Y' (capital)" remark. If all input was lower cased, of course, you'd be right. Still it would be no reason for the application to hang, but maybe that's another story and completely unrelated to the UserInput class...
However, I'd go with the "It's a game" option, where each developer must add another yes/no option when he modifies the application.
Admin
That seems a little tricky to represent as a string. We'll have to roll some kind of action class especially for this prompt that can be easily compared to a string for the regular "no", "nay", "nein", "NEVER!!!11!!!" responses.
Admin
Won't work. What if I answer in German? Then it would be "J" or "j" for "Ja".
Or, what if I answer in Japanese? Now your options for yes are "u" and "h" (un / hai) and your options no are "u" or "i" (uun / iie). And yes as you can see, "u" is ambiguous. Oh and what if I enter my answer in hiragana? Now you need to add う、は、い and you still have the problem with う being ambiguous...=)
Admin
Admin
I'll just run the following "yes|{this program}" and go to lunch and be infinitely more productive!
Admin
Admin
So there's a hardware component as well?
Admin
I was kind of thinking the same thing... There's no js "confirm" equivalent?
Admin
No, TRWTF is that the original developer had used the "ReadLine" function instead of using "ReadKey" and continue the processing as soon as someone hit the 'y' key
Admin
I never really understood why "yeah" is affirmative, "right" is affirmative, but "yeah right!" is negative.
Double positive? Two rights make a wrong, I guess.
Admin
That requires fuzzy logic. While the programmer was definitely fuzzy, he was clearly lacking logic.
Admin
Now I am confused. Fer sure doesn't really fit with the theme. Is the result of your comment done by democratic means?
Admin
Where can I find a definition of this language? I'd like to write programs in it. That would be fun.
Admin
Admin
what? no file not found?
Admin
...I clicked cancel.
Admin
Admin
if (answer.equals("maybe")) { return rand(rand(rand(rand({True,False})))); }
Admin
This was almost my thought. I'm thinking some moron up in management rather than the programmer's boss, though.
Admin
I have been trying to think of a counter example for that... and I can't.
Good work.
Admin
A part of me is hoping that there ARE two buttons, but they return a text value to the code and, for sylistic reasons, the values of the buttons have changed to something like "YES!" and "No thank you".
Admin
Nevermind "maybe," hopefully he put in a test for "File not Found!!"
Admin
Admin
Nay
Admin
The real WTF is all those statements just to check if the answer was meant to be yes. A substr into a string of all the right answers does it in one statement.
Admin
if (answer.equals("eh")) { return true;
if (answer.equals("neh")) { return false;
why not take battle school slang?
Admin
Jota, I see that scenario all the time. Every time some programmer rails against the stupidity of the previous programmer, I just start playing scenarios like that in mind. I can't tell you how many decent programmers out there have bad reputations simply because the users demanded that they program it that way. That is why it is vital to only attach your name to good code and leave no trace of your identity on bad code.
Admin
Admin
Yet another reason the guys at Sun should stop fucking with the API. Why replace .equals() with something that is exactly the same?
Admin
That is no excuse for crappy programming. Just because the users want something, that doesn't mean you can't code it right behind the scenes. The UI may be a mess because they want flashing neon pink buttons, but you don't have to be a retard about how you handle the action performed.
Admin
That was the sarcasm option.
Admin
This is the last time I'm filling in for you. Once more, and I'll hide your reaching broom!
Admin
Don't forget "v" for vâng and "k" for không... then there's 是,对,and 不。
What the heck is a "nisl" ?
Admin
Your QA get paid by the bug report too?
Admin
Because Yeah Right is almost always sarcastic. Saying it without sarcasm is a positive