- 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
The real wtf is that three spaces is ok.
Admin
What I wouldn't give for a TRIM function...
Hey, wait...!!!!
Admin
Unbelievable that such programmers get serious jobs...
Admin
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? :)
Admin
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.
Admin
With a regular expression.
Admin
Admin
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 )
Admin
ooh, ooh, can i be the first to point out how three spaces looks like one space in HTML!?!!11one
Admin
Admin
oooh, AdT beat me. :( :( :(
Admin
... }
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".
Admin
With a loop, of course! (C++ RULZ, VB for kiddidz HA!!!)
Admin
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.
Admin
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
Admin
Damn you and your beating everyone to the Alex-bashing!
Admin
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.
Admin
I'd also like to point out that not only could be used, but
Admin
There should be a prize for finding the real WTF.
Admin
i r 1337 hax0rz, i r try break syst3m with 2 spaces... ohnoes! they check for it! i r deefeeted :(
Admin
He's not alone, apparently.
Admin
Admin
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.</p> </title>
Admin
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.
Admin
Shhhh, don't mention it. Now someone will quote Zawinski.
Admin
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
Admin
I don't get it, I write code like that all the time.... ;-)
Admin
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.
Admin
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..
Admin
TRWTF is that they write JavaScript but use Microsoft prefixes for the labels and text boxes
Admin
Admin
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.
Admin
This example lacks recursion, I have instant dislike of it.
Admin
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
Admin
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!".
Admin
Sounds like an XKCD moment...
"This form still accepts spaces! What are we gonna do?!?"
"Everybody stand back! I know regular expressions!"
Admin
The real WTF is that they first set the label visibility, and then text, which leads to unnesessary flickering.
Admin
What is with the Constant Viagra ads?
Is this industry really plagued by ED? I've only just started out :[
Admin
Then you just replace "unbelievable" with "frustrating as hell".
Admin
Admin
Admin
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.
Admin
That might be because it's not JS... It's C#. The properties being accessed sure look like server-side control properties to me.
Admin
Not if this is server-side C# code...
Admin
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.
Admin
This is probably the worst demographic for marketing Viagra: most programmers are young and many have trouble getting laid.
Admin
IMHO it looks like C# - server-side validation @ASP.NET
Admin
[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; }
Admin
Admin
wait, is that Drop users or '; drop users;--?