- 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 WTF here is obviously that you could just call the ASP file in a new window, which would Response.Write "email sent" on success, and then offer you a button to close it which would render the previous screen visible.
The second WTF, using AJAX to fix the problem. Totally a winning solution, to add more complexity to a screwed system to make it even more WTF.
The third WTF, why not just have the ASP code in the first place and refresh the page with detection of whether or not a form variable in the request object is set, and run an email.
OMFG.
Admin
TRWTF? ASP.
TRRWTF? Not being first.
Bah!
Admin
the fact that you're there would suggest that you can't get work with people that are less useless doing something more interesting than baby sitting a cobbled together crud application in classic ASP ..
my advice would be get out or shut up and deal with it ;)
Admin
ASP with PICK. Now, that is the most disparate combination I could possibly think of!!
Admin
This has nothing to do with PICK, and everything to do with the fact that people who code pop-up windows should have their fingers broken.
Admin
I guess whenever you consider submitting a WTF you should consider your solution. Unfortunately smugness can get in the way of you seeing that you are just perpetuating the WTF.
You immediately saw the proper way of doing it but, due to insufficeint knowledge, went and hacked it in another way. This is one of the biggest crimes in development. And boy is this crime rife! There seem to be far to many people not willing to put up their hands up and say: "I don't know". There's nothing wrong with acknowledging the fact you don't know because then you have the opportunity to go and research it properly.
Anyway, the fact that old ASP was being used is not a WTF. You would be a very lucky developer indeed if you got to pick the technolgies you used for every project! In most cases it is not even dumb project managers who select the technologies, but the even dumber customers!
Admin
Interesting. Someone is posting their own code here to get feedback.
Alex, maybe you should make a new category for that for fledgling developers.
Admin
+1
Lame "WTF".
Admin
Getting the asp file to remove itself? If one is not careful that could be a gaping security hole right there
Admin
However, it did the job of keeping a dead system limping along and made some the lives of some customers who have to use it easier.
It also did it without introducing any further problems.
Admin
Admin
Smugness? I was in no way proud of my code in this solution. I thought it was a horrible hack, but it kept the system going for a bit longer. TRWTF was that the fix was in some ways worse than the problem.
I've now had the time to re-write that bit of code properly and remove that particular WTF.
Admin
So, let me get this straight:
"Hmm... This code is causing something odd to happen." "Oh, why didn't they use the built-in e-mail functions instead of creating a sub-par work-around?" "I'm going to fix it by creating a needlessly complex work-around because I don't know the built-in e-mail functions either."
So, is this a self-realizing WTF? "Hey guys! Look at this WTF I made! Post it on your site!"
Admin
Oooh, I just got the PICK-shivers. Two years of my life I'll never get back...
=== http://nomagichere.blogspot.com
Admin
From a debugging standpoint, wouldn't you want your error messages to be slightly different on why the email failed to send?
At least then you could go directly to the cause of the problem instead of having multiple places to check because they all have the same error message.
Admin
That's a huge assumption. I maintain a bunch of PHP applications, but once every month or so, someone comes up from the dungeon to complain about a bug in one of the old ASP apps we are phasing out. I merrily fix it as quickly and ugly as I can since we were told not to worry about any kind of future maintenance or code quality.
Admin
I think that the Ajax version is OK. It probably took all of 5 minutes to write, compared to what might have been several hours learning everything necessary about PICK to write and test an internal notification system. As long as the intent was to do it properly afterwards (i.e. book it as "technical debt"), then it's reasonable enough.
Having an ASP page delete itself, on the other hand... that's more than a little disturbing. How about just checking the user-agent or putting in a robots file?
Admin
Non-idempotent FTW!
Admin
OK, I'm going to sound like a complete noob here, but... what's PICK? This is the first time I've ever heard of it.
Admin
Actually it was more that the method of sending email was hard coded into about 100 places in the application, and this was a quick fix that could be done in one place to keep things going until it could be done properly.
Admin
PICK is its own WTF. And its inventor was a Dick.
I worked for two years on PICK Basic infested with WTFs; that language is to WTFs what soft wood is to termites.
I have a sharp, burning stick for the eyes of the first idiot who says "you can write bad code in any language."
Admin
The real WTF = alert ('Could not send email due to popup windows being blocked');
Admin
And by the way, if I had found a badly built wall in my house that could seriously effect the stability and safety of the house then yes, I would do the proper job and rebuild it. Even at a greater cost. Take some pride in your work.
Admin
Definitely not defending PICK. But I must say it:
"But you CAN write bad code in any language!"
Admin
TRTRWTF: someone who instantly blames the technology in use when it's nothing whatsoever to do with the problem.
Admin
Admin
http://en.wikipedia.org/wiki/Pick_operating_system
Admin
Admin
ASP + PICK?
You could call it ASPIC, it's so slow.
Admin
TRRRWTF: someone who doesn't realize that ASP is responsible for 99.999% of the worlds problems -- including world hunger, Rosie O'Donnell's pants, and the soon-to-arrive world war between behavioral scientists and militant vegans
Admin
I actually did google it, but didn't know if it was specifically a language, framework, or OS. Just searching for "PICK" is sort of generic.
Admin
When you only have a hammer, everything looks like a nail.
Admin
emails emails emails
How often to you check you mails at the Post Office? How long are you going to follow the fools who don't know how to equate mail with email and letter with eletter?
You all sound like toddlers trying to speak the language.
Admin
TRWTF: Going into these comments and trying to defend yourself against the nitpickers. That is a completely no-win situation.
Admin
Admin
Can nobody spell the word "occurred"?
Admin
According to Wikipedia:
turns valve and fills cube with superheated steam
Admin
Buy a house move in It rains, and you notice the roof is leaking Put a bucket under the leak When it stops raining, inspect the roof.
Determine what all needs to be fixed and how to fix it. Fix the darned roof.
Sounds like hulver did the right thing to me.
Admin
I spent the first couple years of my career working on Pick & Unidata systems (and it pretty much killed my career prospect until I got my SCJP cert). We never had any problems sending emails from a Pick system. In fact, all the confirmation emails from a certain online flower company with a three-letter name came from an HP-9000 running Pick D3 until a couple of years ago.
All this back & forth in the OP could have been fixed by running Pick on a Unix operating system instead of Windows. We just wrote our emails to temporary files and called sendmail using the Pick equivalent of system().
In a pinch, PickBASIC in D3 supports sockets. You could open a connection to port 25 & write your own SMTP client.
But, I have to agree with the previous poster who noted that most Pick systems are a mess of WTFs. You can write some really cool code in Pick if you know what you're doing. But, there's a lot of Pick developers out there who know how to write the same report 30 different ways and that's about it.
Admin
And while you were researching how to rebuild it right, would you leave it alone to collapse on itself, or would you put in a quick brace to support it while you got everything you needed together to do it right?
Admin
omfg, you're my hero...
Admin
AND
Hmm. I read the article through and could not see anywhere a statement saying that quick fix was needed. What I read was a solution was needed. Try this:
That would be closer to fixing the leak in the roof. Only in the comments did the author say a quick fix was needed. And as you will notice, his comments arrived after mine.
I still stand by attitude towards "hacks". If a solution is required then a solution should be provided. Too often kudos is wrongly given to someone who can hack code to get it working again. Writing bad code on top of bad code because "it's already bad" is not the attitude to have.
Admin
What if the user has disabled javascript?
Admin
I find that it's _well-built- walls that effect the stability and safety of my house. Badly-built ones merely affect it.
Admin
Thank you for educating me Pedant :D
Admin
WTF is all you are thinking that Searching Engine will have javascript enabled
Admin
Admin
Still a terrible, terrible hack, but now I understand why a novice might consider it.
Admin
I WILL BRING THEM A SUITABLE TIE!
Admin
How about this:
I suppose I read that differently.