- 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
What the...
Admin
A true WTF. The kind that makes you think "No way is this possible" because nobody could be capable of writing code without knowing string concatenation.
Admin
"ptth" so aptly describes this wtf.
It pttheth me off. It'th the ptth. Pthththth! :-P
-Dave
Admin
Brilliant!
I do think, however, that this was more a fun little exercise for the original programmer than anything else.
Admin
I knew it would be something like this when I saw the front page teaser, but I didn't suspect it would be this bad.
Speaking of bad: Captcha - riaa
Admin
That's ingenious! Bravo!
Admin
Pure genius!
Admin
I have never been so bored that I would do something like that.
Hmmm, maybe the program ran too fast and he had to slow it down. It may be enough, but, instead of just reversing it, he should apply a couple of ROT13's, just to be sure.
Admin
Please tell me this is a grand cosmic joke?
Admin
WOW...just wow
Admin
at least his solution didn't involve converting the things to the ASCII code, casting as an int, and then recasting back as a character.
maybe he was getting paid by the line?
Admin
This is no WTF at all, gentlemen! Much like saying "Richard Dawkins" three times in front of your mirror in the dark causes the Dark Lord of Atheism to appear, demanding a sandwich, using the despicable + operator to append one string to another invokes the horrible StringBuilder class! This lazy and ignorant class will naïvely add one string to another, with no thought at all of whether the two strings fit together! Why, with no consideration of breeding or standing, it is no wonder that programs that utilize this anarchist class end up horribly buggy and inefficient, unable to recognize their place next to their betters! This code snippet, on the other hand, wisely places one mere character next to the other, reserving space such that the two do not mingle. This snippet, gentlemen, preserves the purity of the urlString from the mongoloid and frankly simian apings of protocolString, keeping it pure and chaste.
Gentlemen, when strings can co-mingle freely, our society will be ruined and our downfall terrible to behold, as bastard children will run about the streets, attempting to stick their periods and commas in anything they run across. And that, dear sirs, is not a world I wish to live in.
Admin
??FTW
Admin
I like how the google ads on the side are for such relevant items as 'Bass Strings' and 'String Cheese'.
Admin
I really don't know what else to say than wow. Knowing about enumerators but not knowing string concatenation.. Spectacular.
Admin
What if somebody put a URL in the dataset with the ??\:PTTH
Then they'd really be screwed.
Admin
Stringy coders never cease to amaze me.
Admin
omg
Admin
There are computer scientists, then there are Code Artists. This guy is of the later. It would take years to appreciate the nuances of such a means of concatenation, delving into the poly-politcal meanings of each character, eventually learning of the heuristic meanderings of logic.
If you chastise this code, you hate art and baby Jebus will kill a kitten.
Admin
I teach a brief class on how to make and use a web site for your Toastmasters club. In it, I refer to TI HQ's site submission form as "Mensa software": smart, but sometimes too smart for its own good.
-Dave (webmaster, Fairfax Toastmasters)
Admin
This has got to be one of the best WTFs in weeks.
Captch: doom. Not sure if it's refering to the game, or this guys career.
Admin
I can safely say that I am in awe.
Admin
This is one of my favourites ones so far :) The wrongness and creativity all jump out immediately, congratulations.
Admin
WOW.
This is a good WTF. I haven't seen something like this in a while.
Admin
i shouldn't drink coffee when reading wtf. what a mess....
insanely great codeSOD, thanks. i mean... hell, no!
(fitting captcha: muhahaha)
Admin
This use of PadLeft is pretty ingenious, assuming that this guy didn't know about concatenation. Truly ptth-y code.
Admin
Good grief. What possible reason could someone have for doing that other than job security via obfuscation?
Admin
code as performance art.
nice.
Admin
Admin
<nitpick>
This is C#, so StringBuilder won't be involved. Instead, String.Concat(s1, s2) will be used, which would permit a single char[] array allocation for the resulting string (since the size of s1 and s2 is known within String.Concat()).
</nitpick>
Admin
And I thought the WTF was in the article spelling. :)
captcha : stinky
Admin
well.. this guy never learned the first class of basic algorith, but he really understand how to pad left!!!
there should exist a programmer license someday....
Admin
great comment! made my morning ... thank you :)
I have to believe that this guy was just bored out of his mind, maybe? Like he gets 1 simple, trivial programming assignment per week that takes minutes to do ... I had to fight that at my current job a bit. The previous programmers would take 2-3 months to implement an "are you sure?" prompt, so people here got used to things taking so long. So I would get a heads up to clear my plate for a "big project next week" and it would be something like that. Granted, I would still not code it backwards or anything like this since I could usually find plenty of other things to work on (and plenty of other WTF's to rewrite) .....
anyway, that's the only logical explanation that i can think of ...
Then again, why try to apply logic to a WTF?
Admin
This one hurt, really HURT!
To the one who messed this up: Stop coding or start reading ...
captcha: muhahaha (I don't really feel like that right now)
Admin
That, lady and gentlemen, is pure commenting genius.
Admin
This is too creative to be by accident. I'm convinced the author had to be laughing his ass off as he wrote this.
Admin
er.... no, the + operator doesn't have anything to do with StringBuilder in C#.
Admin
Don't get me wrong - Alex's stories usually crack me up, but it seems that the shorter the story and code snippet, the more hilarious the wtf.
Admin
This must have been made by someone who was just bored. The code does a lot of "advanced" stuff and if a programmer knows how to do that, (s)he also knows about string concatenation.
Admin
sure?
Admin
Is the most funny code that I never see.
... and I want to see the rest of the code, if you dont know how to concat, the rest must be sure better :P
Cheers
Admin
I wouldn't be surprised if this coder's efficiency was based on lines of code in a day. You have got to love upper management's love for metrics - which smart developers know there is always a short way and a long way to accomplish a certain thing.
Captcha: Yummy, yummy metrics...
Admin
Or just had a massive brain fart. I've written complicated kludges of code or spent hours trying to get something to work, when there was a neat, short way around it but it just wasn't clicking. Last week I spent several hours trying to get a pop-up confirmation box to work (it wasn't just the box but a bunch of variables I was also trying to manage) until I went for a walk to clear my head and remembered I had already implemented a very quick and simple error catching / displaying system... and I could just use that instead of the stupid pop-up.
But if someone brain farted and didn't think about string concatenation (something you learn in an introductory programming class back in highschool), then there's not a lot of hope for them as a coder. O_o
Seejay
Admin
duh, everyone knows the proper way to do this is a simple one-liner:
return (urlString.reverse() + "//:ptth").reverse();
Admin
I cry foul...I think someone made this up. In fact I suspect a few of these WTFs lately have probably been made up by the commenters here.
Admin
Anyone tried to do a Google code search on:
PrependProtocol(string urlString)
I get "Your search term - - could not be parsed: missing ) (PrependProtocol(string)"
is this a Google wtf, I've never seen an unparsable search on Google?
Captcha: bathe - yeah, I feel like I need a bath after this snippit
Admin
The real WTF is that this guy isn't using FireFox with adblock extensions
Admin
Obviously done by someone who was given this task and told "You'll have to use concatenation to do this!" And he/she proved them wrong.
Admin
this is the most clever piece of code i've seen posted. It's horrible, but still clever.
Admin