- 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
You want to be very careful saying that out loud. Do not call up that which you cannot put back down.
Admin
The very definition of the phrase "trwtf"
Admin
come on, don't you love doing some on the search function? I do. It's my favorite thing, I do it all the time! :)
(well, my favorite thing besides the obvious)
Admin
The fact that they use CF tells me that they regularly change production data by using the Edit Rows function in SSMS.
Admin
GOD DAMMIT!
Admin
But is it one of your favorite strings?
Admin
No, that would be "Brown paper packages tied up with %s"
Admin
if comment EQ "" cfset comment = "Chargoggagoggmanchauggagoggchaubunagungamaugg"
Admin
Admin
song.Dispose();
Admin
If you want me, I'll be with the sheep.
Admin
My favorite brain melting song goes like this:
Meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow!
(http://www.youtube.com/watch?v=5JuVHCJVYf4 if you don't remember or happily were never subjected to said torture.)
Admin
I'll bet you will. Hey, McLeod! Get off of my ewe!
Admin
Once again we get a code sample where a programmer fixes a problem by using a "magic string".
Admin
The hills are alive with the sound of music.....
Sorry, wrong Julie Andrews movie. Never [Emily Litella] mind.
Admin
You want long words? Forget English and choose German:
Oberdonaudampfschifffahrtsgesellschaftskapitäswitwenrentenantragsformulartitelzeilenendbuchstabengrößenangabe.
(Upper danube steam ship company captain's widow rent applicance form title line end letter size value)
Admin
Admin
The obvious approach to this problem is to create a thingy that responds to a search for "supercalifragilisticexpialidocious" and make sure it thoroughly insults the reader in the most vile terms possible. (Like maybe calling them a VB programmer...)
Then just sit back and wait for the complaints to pile up, forcing management to authorize fixing the actual bug instead of papering over it.
If they merely change the magic word, rinse and repeat...
Admin
Whenever I need a magic string that should never appear in real-world data, I use something like this:
"~~~!!!~~!~! THIS STRING SHOULD NEVER APPEAR IN REAL-WORLD DATA AND IS USED TO MEAN insert meaning here . IF IT DOES APPEAR IN REAL-WORLD DATA, THIS APPLICATION WILL PROBABLY BREAK OR BEHAVE IN AN UNPREDICTABLE WAY ~~~~!!!!~~~~"
It has the benefit of being self-documenting, and if it ever does show up in real-world data, someone is clearly messing with the application's head.
Admin
I'll probably take some flak, but I can see valid reasons for doing this rather than any of the other suggestions (bypassing search, returning the user to the search page, etc).
Time constraints: If the dev had another 50 critical bugs to fix that day, there's no reason he should spend any more time on this bug. An if statement and a comment suffice.
Global search: He can't return the user to the original page. If this search appears at the top of every page, then he'd have to go through the pain of ensuring that every form in the application was correctly populated on a bad search.
One-off effects: If the search operation has one-off effects, then it's far easier to pass it a bad string than try to reproduce those effects outside of the search operation.
Bear in mind that if the above apply, it indicates a WTF somewhere further down the line. But we knew that when we found out the search API didn't allow empty strings.
Really, the best suggestion I've seen was by RobFreundlich - the actual string should be self-documenting.
Admin
It would be a real WTF if the client was Disney and people were trying to find the correct spelling.
Admin
Admin
<cfif Trim(url.searchText) EQ ""> <!--- empty string will cause an error ---> <cfset searchString="If you are reading this, you are likely a fellow coder, or a general web geek. We have to pollute our code with this crap because the stupid fecks on the [insert team name] team at [insert company name] cant write an API worth a damn. No search string generates a 500 error from that pile of stinking mess they delivered, so instead, you get to read this."> </cfif>
Admin
Mahatma Gandhi, as you know, walked barefoot most of the time, which produced an impressive set of calluses on his feet. He also ate very little, which made him rather frail and, with his odd diet, he suffered from bad breath. This made him a...
super calloused fragile mystic hexed by halitosis.
Admin
Admin
I think we can all agree that the real WTF is the brain dead .NET webservice API that they were using to do the searching.
Admin
Admin
CJFNNCNNOLIIEHREHCDMUCDGERWP is probably a Welsh word.
Admin
Admin
Although you can type it backwards, which is dociousaliexpiisticfragilcalirupus, but that's going a bit too far, don't you think?
Admin
So TRWTF is that the DAL code was off limits, and he should have used wrapper pattern? Which, in a sense, he did?
So TRWTF is that there is no RWTF?
Admin
Admin
Luckily, Bobx can automatically catch this exception and produce a meaningful error message in less than 20 lines of code.
Admin
Admin
neminem - I'm glad I'm not the only one here that appreciates Tom Lehrer.
I randomly walk around singing "per clementina si!" when the mood strikes me :)
captcha: nimis
Admin
Why exactly was Brian testing with an empty string, anyway? I hate it when devs do crap like that.
Admin
Didn't you know? Microsoft is replacing Visual FoxPro with Visual ColdFusion++ .NET Live Edition
if this sentence didn't give you chills, you are probably not human.
Admin
Admin
Oh I'm sure it worked as well as any super sophisticated SQL LIKE query would...
Admin
Admin
The correct solution to this problem would have been,
Admin
I'll be in my bunk...doing some.
Admin
Admin
Admin
Admin
Admin
Go fly a kite.
Admin
Admin
If you were someone who used visual FoxPro, then you weren't human already.
CAPTCHA: nobis - Only a nobis uses FoxPro.
Admin