• fruey (unregistered)

    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.

  • bitblit (unregistered)

    TRWTF? ASP.

    TRRWTF? Not being first.

    Bah!

  • ant (unregistered)

    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 ;)

  • (cs)

    ASP with PICK. Now, that is the most disparate combination I could possibly think of!!

  • Pick Me (unregistered)

    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.

  • JJK (unregistered)

    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!

  • anonnoob (unregistered)

    Interesting. Someone is posting their own code here to get feedback.

    Alex, maybe you should make a new category for that for fledgling developers.

  • (cs) in reply to anonnoob
    anonnoob:
    Interesting. Someone is posting their own code here to get feedback.

    Alex, maybe you should make a new category for that for fledgling developers.

    +1

    Lame "WTF".

  • Mr Pedantic (unregistered)

    Getting the asp file to remove itself? If one is not careful that could be a gaping security hole right there

  • (cs) in reply to anonnoob
    anonnoob:
    Interesting. Someone is posting their own code here to get feedback.

    Alex, maybe you should make a new category for that for fledgling developers.

    I don't need feedback on that code, I know it's a horrible solution.

    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.

  • d000hg (unregistered) in reply to JJK
    JJK:
    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.
    If you have the choice between a quick dirty fix, or a proper solution which will require a lot of work, it's idealistic to suggest you always do the latter. This is the real world, the bad code already exists, and has to be addressed appropriately. If you find a wall has been built badly in your house, you would normally find a way to strengthen the wall rather than tear it down and rebuild.
  • (cs) in reply to JJK
    JJK:
    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.

    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.

  • Frunobulax (unregistered)

    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!"

  • Marc (unregistered)

    Oooh, I just got the PICK-shivers. Two years of my life I'll never get back...

    === http://nomagichere.blogspot.com

  • (cs)

    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.

  • (cs) in reply to ant
    ant:
    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 ;)

    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.

  • (cs)

    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?

  • DL (unregistered)

    Non-idempotent FTW!

  • (cs)

    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.

  • (cs) in reply to Frunobulax
    Frunobulax:
    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!"

    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.

  • (cs) in reply to Marc

    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."

  • AnonyMOUS (unregistered)

    The real WTF = alert ('Could not send email due to popup windows being blocked');

  • JJK (unregistered) in reply to d000hg
    d000hg:
    JJK:
    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.
    If you have the choice between a quick dirty fix, or a proper solution which will require a lot of work, it's idealistic to suggest you always do the latter. This is the real world, the bad code already exists, and has to be addressed appropriately. If you find a wall has been built badly in your house, you would normally find a way to strengthen the wall rather than tear it down and rebuild.
    I'm not talking about rebuilding a database, redesigning all the business logic and a code rewrite. I was talking about spending, lets be honest, a couple of hours research (google?) and then maybe another hour implementing the proper solution.

    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.

  • JJK (unregistered) in reply to Numeromancer
    Numeromancer:
    I have a sharp, burning stick for the eyes of the first idiot who says "you can write bad code in any language."

    Definitely not defending PICK. But I must say it:

    "But you CAN write bad code in any language!"

  • Quango (unregistered) in reply to bitblit
    bitblit:
    TRWTF? ASP.

    TRRWTF? Not being first.

    Bah!

    TRTRWTF: someone who instantly blames the technology in use when it's nothing whatsoever to do with the problem.

  • (cs) in reply to hulver
    hulver:
    ... this was a quick fix that could be done in one place to keep things going until it could be done properly.
    I agree with you. Yes, in an ideal world, we should fix this once and for all, the right way. Unfortunately, we live in a less than ideal world where we have to resort to these kinds of tricks. You did the right thing, first fixing the problem and then, when opportunity arose, fixing the code.
  • Noob Cloo (unregistered) in reply to DylanW
    DylanW:
    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.
    No, the complete noob part is that you've never heard of Wikipedia.

    http://en.wikipedia.org/wiki/Pick_operating_system

  • ambrosen (unregistered) in reply to AnonyMOUS
    AnonyMOUS:
    The real WTF = alert ('Could not send email due to popup windows being blocked');
    Right: you do know the difference between a message box and a new browser window, don't you?
  • (cs) in reply to ParkinT
    ParkinT:
    ASP with PICK. Now, that is the most disparate combination I could possibly think of!!

    ASP + PICK?

    You could call it ASPIC, it's so slow.

  • bitblit (unregistered) in reply to Quango

    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

  • (cs)

    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.

  • Dan (unregistered)

    When you only have a hammer, everything looks like a nail.

  • Dennis C. Fait (unregistered)

    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.

  • Neil (unregistered) in reply to hulver
    hulver:
    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.

    TRWTF: Going into these comments and trying to defend yourself against the nitpickers. That is a completely no-win situation.

  • (cs) in reply to Frunobulax
    Frunobulax:
    So, let me get this straight: *snip* "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."
    What he said was, "Not quite confident enough in my first month to refactor the code to call the internal email routine, I leveraged my knowledge of AJAX to solve the problem." My impression of this was, not that he didn't know the built-in functions, but that he didn't think that he in his n00bism to this job could presume to rip out a chunk of code that someone previously had written for some reason that was apparent to them, but not to him, and replace it with something completely different.
  • Malcolm Parsons (unregistered)

    alert('An error occured while sending your email. Your email could not be sent');

    Can nobody spell the word "occurred"?

  • (cs) in reply to Noob Cloo
    Noob Cloo:
    DylanW:
    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.
    No, the complete noob part is that you've never heard of Wikipedia.

    http://en.wikipedia.org/wiki/Pick_operating_system

    According to Wikipedia:

    The Pick OS invites comparison with MUMPS.

    turns valve and fills cube with superheated steam

  • (cs)

    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.

  • Dave Ross (unregistered)

    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.

  • Pyrtolin (unregistered) in reply to JJK
    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.

    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?

  • lImbus (unregistered)

    omfg, you're my hero...

  • JJK (unregistered) in reply to Pyrtolin
    Pyrtolin:
    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.

    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?

    AND

    jimlangrunner:
    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.

    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:

    1. Code breaks because a server regional setting is changed which changes the format of a string being returned.
    2. Customer complain, the boss gets on the phone and wants it fixed.
    3. Developer hacks function that handles the date change.
    4. Same developer then files issue saying that a code refactor is needed that uses integer timestamps or similar rather than date strings.

    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.

  • (cs)

    What if the user has disabled javascript?

  • pedant (unregistered) in reply to JJK
    JJK:
    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.

    I find that it's _well-built- walls that effect the stability and safety of my house. Badly-built ones merely affect it.

  • JJK (unregistered) in reply to pedant
    pedant:
    JJK:
    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.

    I find that it's _well-built- walls that effect the stability and safety of my house. Badly-built ones merely affect it.

    Thank you for educating me Pedant :D

  • CAPTCHA: BS (unregistered)

    WTF is all you are thinking that Searching Engine will have javascript enabled

  • Face Palm (unregistered) in reply to CAPTCHA: BS
    CAPTCHA: BS:
    WTF is all you are thinking that Searching Engine will have javascript enabled
    Did you miss the part where he said directory indexing was enabled?
  • Face Palm (unregistered) in reply to Dave Ross
    Dave Ross:
    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.

    Ahhhhh. That helps explain the inspiration for this horrid WTF. There's no easy way to send email in Pick, so they came up with this convoluted method of making asp do it.

    Still a terrible, terrible hack, but now I understand why a novice might consider it.

  • (cs) in reply to dtech
    dtech:
    What if the user has disabled javascript?

    I WILL BRING THEM A SUITABLE TIE!

  • (cs) in reply to JJK
    JJK:
    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:
    1. Code breaks because a server regional setting is changed which changes the format of a string being returned.
    2. Customer complain, the boss gets on the phone and wants it fixed.
    3. Developer hacks function that handles the date change.
    4. Same developer then files issue saying that a code refactor is needed that uses integer timestamps or similar rather than date strings.

    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.

    How about this:

    hulver:
    Not quite confident enough in my first month(emphasis added) to refactor the code to call the internal email routine, I leveraged my knowledge of AJAX to solve the problem.
    I suppose I read that differently.

Leave a comment on “PICKing Javascript”

Log In or post as a guest

Replying to comment #:

« Return to Article