• (cs) in reply to boog
    boog:
    anon:
    boog:
    D-Coder:
    Sometimes the right answer is "No problem, I'll take care of it!"

    (Read TDWTF for two days.)

    "There, it's fixed! Try it again!"

    In some cases that could work for vets. Unfortunately, ethics usually come into play.
    With some owners, that is the ethically correct answer.
    Vets take an oath to protect animal health, not that of the owner, so technically you may be right. Then again, pets are generally viewed as "property" in the cold legal world, so vets have to work within the limits of the owners' idiocy regardless.

    If the animal dies a week after you say "there, it's fixed" you could be in trouble, especially if you charged them for the "fix". This is what I meant by ethics coming into play.

    Unfortunately for the vet, Fluffy's owner is a total dingbat, so about all the vet can do is keep testing for things until she finds something she can actually treat. And as several people have already pointed out, this can be very much like IT at times.

    Furrfu!

    My original point was blowing off the useless user. Doing to an animal would be wrong. (Also reading TDWTF for two days instead of helping some less useless user would be wrong.)

    I do know right from wrong and frequently use that knowledge to help me make decisions. :-)

  • Jamie (unregistered) in reply to airdrik
    airdrik:
    * bug: Boston displays as "OSTON" ** Fix: prepend cities on the east coast with "B" * bug: New York displays as "BEW YORK" ** Fix: replace "BEW" with "NEW"
    Eventually he's going to end up with:

    If city is supposed to be New York Display "New York" ...

  • (cs) in reply to RBoy

    Works as coded!

  • JJ (unregistered) in reply to THG
    THG:
    Darth City:
    I have removed the first letter from your city's name. Pray I do not remove any more.

    hat us ever art f he eal!

    "That wus never part of the deal"?

  • airdrik (unregistered) in reply to Jamie
    Jamie:
    airdrik:
    * bug: Boston displays as "OSTON" ** Fix: prepend cities on the east coast with "B" * bug: New York displays as "BEW YORK" ** Fix: replace "BEW" with "NEW"
    Eventually he's going to end up with:

    If city is supposed to be New York Display "New York" ...

    Or, even better:

    <cfif inlist(left(weather, 6), "LBANY ,BEQUER,TLANTA,...">
      <cfset weather = "A"&weather>
    <cfelseif inlist(left(weather, 6), "OSTON ,ATON R,IRMING,RIDGEP,...">
      <cfset weather = "B"&weather>
    ...
    

    No more bugs. On to the next problem.

  • Larry (unregistered) in reply to Warpedcow
    Warpedcow:
    Anon:
    Larry:
    TRWTF is that some people STILL think that cigarettes are more harmful than marijuana.

    TRWTF is people keep pretending like marijuana is harmless. It may be less harmful than tobacco, but inhaling hot smoke is still not good for you.

    Larry was implying that marijuana is more harmful than tobacco, not less harmful. Or he made an epic fail of a typo.

    TRWTF is that you're obviously part of the minority. Let me try to put it in simple terms: if marijuana was worse than cigarettes, the GOV would legalize it and tax the hell out of it. The FDA knows that if they legalized it, they would be hit with so many lawsuits it would make a Chinese toy company blush.

  • (cs) in reply to Ian Lewis
    Ian Lewis:
    ... Going West to East is just a joke... you were joking I hope...
    You generally have the wind at your back when you travel West to East. Much faster.
  • boog (unregistered) in reply to D-Coder
    D-Coder:
    My original point was blowing off the useless user.
    Nobody objected. (Maybe they agree?)

    I only used your original point to show a contrast between problem-solving in IT and animal science (of which my previous posts suggested a correlation).

  • Remy Martin (unregistered) in reply to Larry
    Larry:
    Warpedcow:
    Anon:
    Larry:
    TRWTF is that some people STILL think that cigarettes are more harmful than marijuana.

    TRWTF is people keep pretending like marijuana is harmless. It may be less harmful than tobacco, but inhaling hot smoke is still not good for you.

    Larry was implying that marijuana is more harmful than tobacco, not less harmful. Or he made an epic fail of a typo.

    TRWTF is that you're obviously part of the minority. Let me try to put it in simple terms: if marijuana was worse than cigarettes, the GOV would legalize it and tax the hell out of it. The FDA knows that if they legalized it, they would be hit with so many lawsuits it would make a Chinese toy company blush.
    I like to smoke both...at the same time...while chugging Old Crow and writing my Daily WTF articles.

  • (cs) in reply to Luis Espinal
    Luis Espinal:
    Jim (the manager of the story) must have thought he was doing this punk a favor, but in reality, he did not. I remember when I started working in this field, I was making a serious coding mistake, and I just couldn't see it (lack of experience combined with overconfidence and lack of sleep.)

    So true. When I was a co-op student (paid intern?) I was creating a tool that had "Action Items". When someone created an Action Item it went into tblOpenActionItems. When someone closed the Action Item, it deleted from tblOpenActionItems and inserted into tblClosedActionItems.

    Another favorite was Action Items had status updates. Initially you could have 4 status updates. Within a week someone had accumulated 5 status updates so I had to add a statusupdate5 column... and so on.

    It took an amateur DBA 15 minutes to set me straight on both of these. For a beginner, they just don't approach things the right way and don't realize that this has been done a million times before and there is a better way.

  • Nome de Plume (unregistered) in reply to powerlord
    powerlord:
    It could be worse. He could have tried to write his own parser for NOAA's web service.

    You laugh now, but NOAA's Weather SOAP service is the only one I ever found to work. I could not access a vendor's SOAP service, and needed to prove the PERL or Python clients even worked.

    I still remember the NOAA toll booth on the Atlantic in Maine. Some poor guy stays there taking ocean samples.

  • Shicago Mike (unregistered)

    I hope he just left "Shicago" alone, since, ya know, close enough.

  • (cs)

    Nice Frankenstein code. I guess it was caused by a zero-index / one-index issue, which has been perpetuated by ugly languages (read: VB) which seem to have been made before the Mayans were discovered. ;)

    This reminded me of that one time when I accidentally did a DEL . on the C:\COREL4 directory and then attempted to undelete the whole directory. Little did I know about the stupid DOS convention of file deletion ... the restored files were fine, but they all started with A. Nice version of ARELDRAW!!!

  • (cs) in reply to airdrik
    airdrik:
    Jamie:
    airdrik:
    * bug: Boston displays as "OSTON" ** Fix: prepend cities on the east coast with "B" * bug: New York displays as "BEW YORK" ** Fix: replace "BEW" with "NEW"
    Eventually he's going to end up with:

    If city is supposed to be New York Display "New York" ...

    Or, even better:

    <cfif inlist(left(weather, 6), "LBANY ,BEQUER,TLANTA,...">
      <cfset weather = "A"&weather>
    <cfelseif inlist(left(weather, 6), "OSTON ,ATON R,IRMING,RIDGEP,...">
      <cfset weather = "B"&weather>
    ...
    

    No more bugs. On to the next problem.

    Until you get to a city with fewer than six letters, and then you get a string length error. Sorry, all you folks in OISE, ULSA, IAMI, ULSA and ENO!

  • airdrik (unregistered) in reply to da Doctah
    da Doctah:
    airdrik:
    Jamie:
    airdrik:
    * bug: Boston displays as "OSTON" ** Fix: prepend cities on the east coast with "B" * bug: New York displays as "BEW YORK" ** Fix: replace "BEW" with "NEW"
    Eventually he's going to end up with:

    If city is supposed to be New York Display "New York" ...

    Or, even better:

    <cfif inlist(left(weather, 6), "LBANY ,BEQUER,TLANTA,...">
      <cfset weather = "A"&weather>
    <cfelseif inlist(left(weather, 6), "OSTON ,ATON R,IRMING,RIDGEP,...">
      <cfset weather = "B"&weather>
    ...
    

    No more bugs. On to the next problem.

    Until you get to a city with fewer than six letters, and then you get a string length error. Sorry, all you folks in OISE, ULSA, IAMI, ULSA and ENO!

    I guess that depends on what exactly is in the variable "weather" when you get to that point, which could be something like "RN:RENO, NV

    82 degrees..." (before chopping off the first 4 digits). I would assume that it actually has the weather data as pulled from NOAA's site, since it adds that "This forecast provided by the NOAA's National Weather Service" chunk after the first char(10) in "weather".

  • Xythar (unregistered)

    Those of us still working in the trenches of CF salute this WTF.

  • Anonymously Yours (unregistered) in reply to Don't know coldfusion
    Don't know coldfusion:
    So, can someone explain where the problem came from in the first place? I assume it's an off-by-one issue with listGetAt, but not knowing the ins and outs of coldfusion, I could be wrong...
    I presently debug and code review CF for a living, which is why I long for death's sweet release. Looking over the code, the most likely root is:
    <cfset weather = right(weather,len(weather)-4)>

    Since there's no data provided this is difficult to diagnose. However, that is the only spot I can't account for, and given the sporadic conditions of the output it fits. I'm guessing the '-4' in there is to cleave off something that occurs before the name of the city actually begins. The root problem is with the data, in that the crap in front of the city is either 3 or 4 characters, which I'm assuming because the author said it's not happening for every city.

    It's impossible to be certain, but that's my best guess of what was going on. If it was only the first city each file, my guess would have been the 'mid(weatherFile,(firstPrePos+5),lastPrePosCnt)' from the beginning of the file was originally +6, but the corrected code had been sent in with the story.

  • Ablue (unregistered)

    This problem could be easily fixed with BobX.

  • (cs)

    This reminds me of an old "Crock" comic strip. Paraphrased (with apologies to the authors):

      static boolean doesSunRiseInEast(String month) 
      {
          return !month.substr(0,1).equals("R");
      }
    

    ...i.e., it works (for English months, at least) but it sure seems irrelevant: and one must seriously wonder about the person who thought it was relevant.

    At least the new intern recognized a bad approach and looked for a better one (rather than layering on yet more irrelevant code). The new intern is a keeper.

  • Mike (unregistered)

    Good thing there was no weather report for Phitsville.

  • (cs) in reply to frits

    So if someone presents you with a fever your solution is to dunk them in ice water?

  • (cs)

    You'd be getting some interesting complaints from people living in White Plains, New York.

  • Grandpappy (unregistered) in reply to Mike

    "Proh-gram?" What 'n hell's a "proh-gram"? Is that some European thing?

    You want 'a see what the weather's like, I'll come by later and smash your window out! Throw yer out the damn window! ...mumble... Whipper... snappers!... ... <snore>

  • asdf (unregistered) in reply to frits
    frits:
    tragomaskhalos:
    attempting to fix the symptom instead of the cause

    Isn't that how modern medicine works?

    Yes.

    I wonder what would be the programming analogy for the 'traditional' medicine which fixes the root of the problem by driving away the evil spirits? Propably by burning a candle in the patients ear while dancing naked.

  • (cs) in reply to airdrik
    airdrik:
    It looks like he was trying to practice TDD. He was given a test to satisfy and he satisfied it. When given a bug - a test case, he changed the code to satisfy it. Given another test case, he did similarly... I suppose the hope is that having enough test cases will eventually result in the truly correct implementation? * bug: San Francisco displays as "AN FRANCISCO" ** Fix: prepend all city names with "S" * bug: Boston displays as "SOSTON" ** Fix: Only prepend cities with "S" if they are on the west coast * bug: Boston displays as "OSTON" ** Fix: prepend cities on the east coast with "B" * bug: New York displays as "BEW YORK" ** Fix: replace "BEW" with "NEW" ... Hmm.. I guess this isn't really going the right direction is it.

    Yeah, pretty obvious that's what was going on there. But what's baffling about that is why the thought never even seemed to cross his mind to try to figure out what was causing the problem in the first place. I think after taking even one entry-level programming course most people would have enough experience to immediately think, "hmm, letters don't just disappear by themselves. Lets try to figure out what happened."

    A guy who labels himself as a problem-solver yet is completely clueless about solving problems in general. Anyone with half a brain would those types of fixes as a last resort -- even an inexperienced intern (who presumably at least had some programming experience in college) should know that.

    Hopefully this was an unpaid internship.

  • Sylver (unregistered) in reply to frits
    frits:
    tragomaskhalos:
    attempting to fix the symptom instead of the cause

    Isn't that how modern medicine works?

    Sure, but it pays a lot better than doing it properly.

    What would be the consequences for the pharmaceutical industry if they started to fix the real causes and if people became healthy as a result?

    That's the problem of an industry whose only function is to fix a problem and which would be destroyed if the problem was fixed.

  • Jim (unregistered) in reply to Rottweiler
    Rottweiler:
    frits:
    tragomaskhalos:
    attempting to fix the symptom instead of the cause

    Isn't that how modern medicine works?

    Dangit Jim, I'm a Doctor, not a Programmer!

    Jantsu is that you?

  • Sylver (unregistered) in reply to boog
    boog:
    Rootbeer:
    Somebody explain to me why Jim allowed Stefan to publish untested, bug-riddled code to the production environment? Repeatedly?
    In addition to testing, this would have been a great opportunity for a code review. Not only can a code review reduce bugs before going to production, but a review can be a great learning experience for an intern.

    Oh, Stefan doesn't want to? Well Stefan is an intern. Stefan doesn't get a choice.

    My feeling exactly. TRWTF is that Jim didn't say: "Sit down. Now, look at the source website. The cities already have the first letter, right? Do they? But after your code grabs them, the first letter is gone. You are a problem solver. Look at your code and find out why it removes the first letter. You have 10 minutes."

  • Matt Westwood (unregistered) in reply to boog
    boog:
    Franz Kafka:
    If you can get a smoker to quit before they get cancer, they'll recover over time. Same with fatties - it just takes time and the understanding that this is a permanent thing.
    You may be right, but from a medical perspective the smoker/fatty may not seek medical treatment/advice until the symptoms they've experienced for an extended time already become too much to tolerate. By then it may be too late to deal with the root cause.

    Consider as a reverse analogy (relating back to IT) a user who lets a bug persist and destroy as many data as possible before bothering to report it.

    The doctor / SW troubleshooter can not be held responsible for the stupidity of the patient / user. If the patient dies / user's account becomes unusable, then good riddance to bad rubbish.

  • Sylver (unregistered) in reply to Franz Kafka
    Franz Kafka:
    boog:
    Franz Kafka:
    If you can get a smoker to quit before they get cancer, they'll recover over time. Same with fatties - it just takes time and the understanding that this is a permanent thing.
    You may be right, but from a medical perspective the smoker/fatty may not seek medical treatment/advice until the symptoms they've experienced for an extended time already become too much to tolerate. By then it may be too late to deal with the root cause.

    Consider as a reverse analogy (relating back to IT) a user who lets a bug persist and destroy as many data as possible before bothering to report it.

    I dunno, you can still fix the root cause, but that won't reverse the damage.

    True, but that doesn't change the issue: you can fix the damage as much as you can, but you have to fix the cause no matter what.

    In the example above, would you try restoring data from back up without fixing the bug that is destroying the data?

    Medicine has the same problem: Take a fat man who does no exercise. You know there are cardiac & arterial problems, that the patient will be easily tired, that the liver is overworked, that the intestines are probably sluggish, and the patient probably suffers from a number of other related ailments... all of these are straight corollaries from a lack of exercise combined with a poor diet.

    The patient comes in complaining about some intestinal pain, it's f* irresponsible to give him a painkiller and send him on his way. It is however more lucrative than really fixing the problem.

  • UK_Aspie (unregistered)

    As long as the new guy didn't tell anyone he was replacing the code. Most places wouldn't allow that.

  • Gondolf (unregistered)

    TRWTF is Cold Fusion

  • (cs)

    Right. I can see why he didn't want to be labeled as a programmer.

    Admittedly this isn't too much unlike how I started out too. We all had to start somewhere, right? It's only unfortunate that he didn't want to listen to a more experienced programmer.

  • Matt Westwood (unregistered) in reply to nwbrown
    nwbrown:
    So if someone presents you with a fever your solution is to dunk them in ice water?

    If the fever is dangerous enough then this may well be the only way to save the patient's life.

    Once you've put the (metaphorical) fire out, then you can go and hunt for whatever started it (to mix in a completely different metaphor for S/W troubleshooting).

  • Matt Westwood (unregistered) in reply to asdf
    asdf:
    frits:
    tragomaskhalos:
    attempting to fix the symptom instead of the cause

    Isn't that how modern medicine works?

    Yes.

    I wonder what would be the programming analogy for the 'traditional' medicine which fixes the root of the problem by driving away the evil spirits? Propably by burning a candle in the patients ear while dancing naked.

    The warmth of the candle was sufficient for me to throw off the debilitating chill, and the sight of, of my goodness what do you look like, made me laugh so hard it got my circulation back up and running in no time. Hey, job done.

  • Marvin The Martian (unregistered) in reply to parliament
    parliament:
    This is coldfusion code? Who thought that would be a good idea --------------------?!
    FTFY
  • Remy Martin (unregistered)

    Dear TDWTF readers,

    In case you can’t tell, I'm a total jerk. The fact that I insist on not posting an article on Tuesdays clearly shows that I am too drunk and too stupid to be posting to this website.

    Why don't I go away and sober up?

    Sincerely, Remy Martin

  • Dan (unregistered)

    Shoudln't Sew York have been Sue York?

  • Anon (unregistered) in reply to Shicago Mike
    Shicago Mike:
    I hope he just left "Shicago" alone, since, ya know, close enough.

    My kind of town, Shicago is my kind of town, Shicago is my kind of razzmatazz And it has all that jazz,

  • Baheena (unregistered) in reply to Remy Martin
    Remy Martin:
    Dear TDWTF readers,

    In case you can’t tell, I'm a total jerk. The fact that I insist on not posting an article on Tuesdays clearly shows that I am too drunk and too stupid to be posting to this website.

    Why don't I go away and sober up?

    Sincerely, Remy Martin

    Dear Desperate in teh Interwebz,

    Looks like you might have to do work today.

    Sincerely, Baheena

  • The Admins (unregistered)

    ATTENTION EVERYONE

    From some of the comments here, it is clear that you have forgotten that Tuesday is TDWTF Sabbath. Despite the misleading name, there are no articles posted on Tuesdays, Saturdays, Sundays, and most holidays. There never have been, and there never will be.

  • (cs)

    For Americans out there, are there any two cities in the USA that have the same name other than the first letter?

  • Jim *Sigh, rolls eyes* (unregistered) in reply to Cbuttius
    Cbuttius:
    For Americans out there, are there any two cities in the USA that have the same name other than the first letter?
    I think you're still missing the point, Stefan.
  • Anon (unregistered) in reply to Cbuttius
    Cbuttius:
    For Americans out there, are there any two cities in the USA that have the same name other than the first letter?

    I was wondering the same thing. Can't think of any, but I'm sure there must be somewhere.

  • he eholder (unregistered)

    STEFAAAN! We have users everywhere calling tech support because of your application. Those from Chicago say their city is being spelled Shicago, the ones from Miami say it is showing Siami, and the ones from Flagstaff are downright angry.

  • WTF (unregistered) in reply to Remy Martin
    Remy Martin:
    Dear TDWTF readers,

    In case you can’t tell, I'm a total jerk. The fact that I insist on not posting an article on Tuesdays clearly shows that I am too drunk and too stupid to be posting to this website.

    Why don't I go away and sober up?

    Sincerely, Remy Martin

    The Admins:
    ATTENTION EVERYONE

    From some of the comments here, it is clear that you have forgotten that Tuesday is TDWTF Sabbath. Despite the misleading name, there are no articles posted on Tuesdays, Saturdays, Sundays, and most holidays. There never have been, and there never will be.

    Well done, thanks to all your complaining we've got a bloody soap-box article. I hope you're all happy now...

  • LB (unregistered) in reply to boog
    boog:
    Unfortunately for the vet, Fluffy's owner is a total dingbat, so about all the vet can do is keep testing for things until she finds something she can actually treat.
    Don't you mean unfortunately for Fluffy? It's not the poor cat's fault that her owner can't articulate the symptoms properly.
  • LB (unregistered) in reply to LB
    LB:
    Don't you mean unfortunately for Fluffy? It's not the poor cat's fault that her owner can't articulate the symptoms properly.
    Oh, and the computer related equivalent would be trying to figure out what the end user needs a program for. In my case, the end-user for most of the software I write is not our direct customer, but our customer's customer, and I don't get the chance to talk to them directly. I have to infer what they need based on what either our customer tells us, or worse yet, what their account rep (in my company) tells me that our customer told him about what the end user needs.
  • (cs) in reply to Anon
    Anon:
    Cbuttius:
    For Americans out there, are there any two cities in the USA that have the same name other than the first letter?

    I was wondering the same thing. Can't think of any, but I'm sure there must be somewhere.

    Kannapolis NC and Annapolis MD (kind of) Also, Bennsville MD and Pennsville NJ

    Addendum (2010-10-05 13:08): One more:

    Reston, VA Weston, FL

  • Bobby (unregistered)

    tefan sucks!

Leave a comment on “Tweaking the Code”

Log In or post as a guest

Replying to comment #:

« Return to Article