| « Prev | Page 1 | Page 2 | Next » |
|
The real wtf is that three spaces is ok.
|
Re: What If Someone Types In " "?
2007-12-07 08:21
•
by
Kluge Doctor
(unregistered)
|
|
What I wouldn't give for a TRIM function...
Hey, wait...!!!! |
|
Unbelievable that such programmers get serious jobs...
|
|
Have you ever checked the requirements? What if it said: invalid input is empty string, or one or two spaces. Everything else should be considered valid.
How would you code that? :) |
|
Screening for basic programming skill during the interview?! Don't be silly. If he says he can code, he can code.
The code is bad? But it works. Maintenance? I have deadlines to keep, I can't be bothered to think about the future. Just stop bothering me and go code stuff. Mental note: fire that guy, he has a negative attitude. |
Re: What If Someone Types In " "?
2007-12-07 09:00
•
by
GordonB
(unregistered)
|
|
With a regular expression.
|
Re: What If Someone Types In " "?
2007-12-07 09:08
•
by
John Doe
(unregistered)
|
Simple: use a Regex! :) |
|
The real..., ok, let's say another WTF is that the title is supposed to contain 4 spaces but Alex forgot about merging of consecutive whitespace characters in HTML so virtually every browser will only display one space. He should have used non-breaking spaces ( if the forum software lets me enter that. :-p )
|
|
ooh, ooh, can i be the first to point out how three spaces looks like one space in HTML!?!!11one
|
Re: What If Someone Types In " "?
2007-12-07 09:12
•
by
meh
(unregistered)
|
If that is the case, what's the false/non-real/unreal wtf? |
Re: What If Someone Types In " "?
2007-12-07 09:13
•
by
Anon Fred
(unregistered)
|
|
oooh, AdT beat me. :( :( :(
|
Re: What If Someone Types In " "?
2007-12-07 09:15
•
by
[ICR]
(unregistered)
|
if(!IsValidInput(txtloginname.Text)) { lblloginMessage.Visible=true; lblloginMessage.Text = "Please Enter the User Id"; return; } if(!IsValidInput(txtcompanyname.Text)) { lblloginMessage.Visible=true; lblloginMessage.Text = "Please Enter the Company"; return; } ... } public static bool IsValidInput(string text) { return !(text == "" || text == " " || text == " "); } Yes it uses double negation, but I prefer to think in terms of "Is this valid" rather than "Is this invalid". |
Re: What If Someone Types In " "?
2007-12-07 09:20
•
by
jkohen
|
|
With a loop, of course! (C++ RULZ, VB for kiddidz HA!!!)
|
|
My buddy Darrell " " Simpkins always uses his nickname as his login id on websites. Not sure what he would do here. He's almost as bad as Smitty "Drop Users" Holmes.
|
|
The real WTF is that the article title does not use forced nbsp spaces, which causes them to be rendered as a single space (superfluous HTML whitespace is invisible), so I only got the joke after viewing the document source. =P
|
Re: What If Someone Types In " "?
2007-12-07 09:39
•
by
morpcat
|
Damn you and your beating everyone to the Alex-bashing! |
|
I wonder what the problem was, that Telly was asked to solve.
I note that their label controls have a special naming convention: dromedary camel case. |
|
I'd also like to point out that not only could be used, but <pre> as well.
|
Re: What If Someone Types In " "?
2007-12-07 09:41
•
by
Sean
(unregistered)
|
There should be a prize for finding the real WTF. |
|
i r 1337 hax0rz, i r try break syst3m with 2 spaces... ohnoes! they check for it! i r deefeeted :(
|
He's not alone, apparently. |
Not inside <title> ... |
Re: What If Someone Types In " "?
2007-12-07 09:55
•
by
morpcat
|
It occurs once within <title>, once within the page. He should be using for <title>, but leave the three spaces in the body. That way, he can add a client-side script to the page to hardcode <pre> in as the page is generated. |
|
WHAT ARE YOU DOING? The virtual crowd hates you! They want more blank spaces!
I guess the guy was paid by the character, not by usability of the product. |
Re: What If Someone Types In " "?
2007-12-07 10:08
•
by
rbonvall
(unregistered)
|
Shhhh, don't mention it. Now someone will quote Zawinski. |
|
This is such an obvious WTF that even I got it after the first reading. That is some scary shitizzle fo shizzle...yo
Captcha is "poindexter" you busters |
|
I don't get it, I write code like that all the time.... ;-)
|
|
This guy isnt just a bad coder, he is also stupid. Not knowing that this can be done with regex makes him a bad coder. Not seeing that the functionality he is implementing is completly bonko-bonko, is just brilliantly moronic.
|
Re: What If Someone Types In " "?
2007-12-07 10:58
•
by
Bob
(unregistered)
|
Wow, just wow.... and when the requirements change comes down that companyname has a different rule than loginname, and some weak programmer modifies the isValidInput routine without proper testing.. Wait.. that's next week's WTF.. |
Re: What If Someone Types In " "?
2007-12-07 11:08
•
by
Cloak
(unregistered)
|
TRWTF is that they write JavaScript but use Microsoft prefixes for the labels and text boxes |
Re: What If Someone Types In " "?
2007-12-07 11:16
•
by
volpone
(unregistered)
|
Then that systems analyst should have his intestines pulled out through this nostrils, onto death. |
Re: What If Someone Types In " "?
2007-12-07 11:27
•
by
Ed
(unregistered)
|
|
Wait -- so you're actually suggesting that repeating the exact same lines of code multiple times rather than putting them in a function is a superior solution because we should always plan for inept programmers?
WOW, just WOW WOW WOWEEEE!! If you had to plan for the "weak" programmers I used to work with, this little snippet would be 200 lines long. |
|
This example lacks recursion, I have instant dislike of it.
|
|
Since this is obviously Javascript client-side validation*,
every "return" should be return false! Otherwise, the form is submitted with bad data and then, what's the point of validating at the client? *The demonic shortcomings of client-side validation is a subject for a differnt discussion |
|
You know it is a real WTF if I can see it right away.
I normally read these things over 4 or 5 times (and some comments) before going "oooooh, i see!". |
|
Sounds like an XKCD moment...
"This form still accepts spaces! What are we gonna do?!?" "Everybody stand back! I know regular expressions!" |
|
The real WTF is that they first set the label visibility, and then text, which leads to unnesessary flickering.
|
|
What is with the Constant Viagra ads?
Is this industry really plagued by ED? I've only just started out :[ |
Re: What If Someone Types In " "?
2007-12-07 12:23
•
by
Thogek
|
Unless you've been around enough of them in real employment situations, which many of us have. :-( Then you just replace "unbelievable" with "frustrating as hell". |
Re: What If Someone Types In " "?
2007-12-07 12:25
•
by
Thogek
|
Then I suppose the WTF would be in the requirements... :-O |
Re: What If Someone Types In " "?
2007-12-07 12:37
•
by
snoofle
|
Yes! It comes from staring at a monitor all day long. |
|
The real WTF is that so many people have wasted their brain cells posting "The real WTF is . . ." messages about such a sad little piece of code.
The fact that it exists is sad enough; let it die with a little bit of dignity! Oh . . . wait . . . it never had any . . . my bad. Continue the assault. |
Re: What If Someone Types In " "?
2007-12-07 12:44
•
by
LiquidPT
(unregistered)
|
That might be because it's not JS... It's C#. The properties being accessed sure look like server-side control properties to me. |
Re: What If Someone Types In " "?
2007-12-07 12:45
•
by
LiquidPT
(unregistered)
|
Not if this is server-side C# code... |
|
There used to be a major OS back in the old days where you could type "stop" to end any program.
The OS checked for equality against the strings "stop" and "STOP". But not any variants. So if you typed "Stop" or "STop" or STOp or sTOP or stOP or stoP it would continue on. Or StoP or SToP or STOp. |
Re: What If Someone Types In " "?
2007-12-07 12:52
•
by
Mogri
(unregistered)
|
This is probably the worst demographic for marketing Viagra: most programmers are young and many have trouble getting laid. |
Re: What If Someone Types In " "?
2007-12-07 12:55
•
by
Velko
(unregistered)
|
IMHO it looks like C# - server-side validation @ASP.NET |
Re: What If Someone Types In " "?
2007-12-07 13:00
•
by
Anon
(unregistered)
|
Good point. How about this validation function as a replacement (done in JavaScript): [code]function isValid(str) { if (str.length == 0) return false; if (str.substring(0,1) == " ") if (validate(str.substring(1))) { // Avoids tail recursion! return true; } else { return false; } return true; } |
Re: What If Someone Types In " "?
2007-12-07 13:01
•
by
Willie Monkey
|
That's beacuse they spend so much time spanking the monkey that it won't come out to play any more; hence the need for Viagra! |
Re: What If Someone Types In " "?
2007-12-07 13:15
•
by
Franz Kafka
(unregistered)
|
wait, is that Drop users or '; drop users;--? |
| « Prev | Page 1 | Page 2 | Next » |