• Nag-geoff (unregistered)

    Every time a new piece of software is added to the code base, Baker said, an addition is made to its technical debt. Code is the principal, and software maintenance is the interest payment, "so the more code we have out there, the bigger our debt, hence the more maintenance, hence the more interest payments

  • Doozerboy (unregistered)

    Just wondering why the web designers don't list PMH foundation as part of their portfolio....

    http://www.perth-web-design.net.au/website-design-portfolio/

    On the other hand, Sara.... Hell yeah.

    http://www.perth-web-design.net.au/about-perth-web-design/meet-the-perth-web-design-team/#Sara

  • David Mårtensson (unregistered) in reply to Peter
    Peter:
    So... and the cart logic was in Javascript? At least I hope it was just for presentation purposes... but somehow I don't think that's the case

    Writing the cart in JS is not a bad idea as long as you have the checkout serverside along with verifications.

    10 years ago I wrote one in JS myself mostly because the server we used to run on was a bit on the week side.

    Using a JS cart saved on calls to the server as only new pages and checkout ran on the server.

    We handled ~1000 simultaneous shoppers on that server which was an P2 or something like that ;)

    But id did have it's drawbacks of cause, like loosing the cart if you hit F5 (it was before I learned to handle cookies) but customers was satisfied anyway, out site was faster than most other carts :D

  • P (unregistered) in reply to PedanticCurmudgeon
    PedanticCurmudgeon:
    Jack Strikes Back:
    Is there any chance that we might make these articles a daily occurrence?
    No, but if you go to the "Side Bar WTF", you'll see 2-3 WTFs per day on average, normally of better (or worse, if you prefer) quality than the front page articles.

    Well. To be honest I would be happy it one day TDWTF run out of materials as there would be no more WTF code. Unfortunately it is unlikely to happen. TDWTF is some consolation however.

  • (cs) in reply to David Mårtensson
    David Mårtensson:
    Peter:
    So... and the cart logic was in Javascript? At least I hope it was just for presentation purposes... but somehow I don't think that's the case

    Writing the cart in JS is not a bad idea as long as you have the checkout serverside along with verifications.

    10 years ago I wrote one in JS myself mostly because the server we used to run on was a bit on the week side.

    Using a JS cart saved on calls to the server as only new pages and checkout ran on the server.

    We handled ~1000 simultaneous shoppers on that server which was an P2 or something like that ;)

    But id did have it's drawbacks of cause, like loosing the cart if you hit F5 (it was before I learned to handle cookies) but customers was satisfied anyway, out site was faster than most other carts :D

    I don't believe for this story to be real. How did code pass QA and review?

  • (cs) in reply to Fred
    Fred:
    Larry:
    What's a "browser"? And which end should I point with?
    If you have a good sturdy pen on your desk, that can be a browser. Hold the sharp end pointing toward your chest, near your heart. Then run down the hall until you collide with the wall at the end.

    I just tried that. It went right through to the other side and made an unsightly blue mark on the back of my shirt. I demand that you PayPal me the cost of a new shirt.

  • qbolec (unregistered)

    Unless she expected negative amounts of items, this should be shortened to:

      item1 = parseFloat(document.form1.Stitches.value);
      item1price = parseFloat(document.form1.StitchesPrice.value);
      item2 = parseFloat(document.form1.FirstAidKit.value);
      item2price = parseFloat(document.form1.FirstAidKitPrice.value);
      item3 = parseFloat(document.form1.Wristband.value);
      item3price = parseFloat(document.form1.WristbandPrice.value);
    
      // ...
    
      item76 = parseFloat(document.form1.HushCD10.value);
      item76price = parseFloat(document.form1.HushCD10Price.value);
    
      var subtotal = 0;
    
          var item1total = item1 * item1price;
          subtotal = subtotal + item1total;
          var item2total = item2 * item2price;
          subtotal = subtotal + item2total;
          var item3total = item3 * item3price;
          subtotal = subtotal + item3total;
      
      // ...
    
        var item76total = item76 * item76price;
        subtotal = subtotal + item76total;
    
  • Waiting...... (unregistered)

    Waiting for geoffery to explain what I've missed here....

  • Fred (unregistered) in reply to Matt Westwood
    Matt Westwood:
    Fred:
    Larry:
    What's a "browser"? And which end should I point with?
    If you have a good sturdy pen on your desk, that can be a browser. Hold the sharp end pointing toward your chest, near your heart. Then run down the hall until you collide with the wall at the end.

    I just tried that. It went right through to the other side and made an unsightly blue mark on the back of my shirt. I demand that you PayPal me the cost of a new shirt.

    No problem Matt. I don't have PayPal installed on my computer though, so post your bank website ID and password and I'll deposit the money direct. (Use white text so other people don't notice.) How much do you want? Be sure to allow for your time going to the store for a new shirt. I'm not a cheap bastard.

  • Devils Advocate (unregistered)

    So they had other priorities (eg making the money they use to pay you) besides refactoring. If you need the code to be cleaner in order to be able to do your job, then refactor it yourself, outside paid hours.

  • Doozerboy (unregistered) in reply to Devils Advocate

    I seriously hope you're trolling

  • Matt Westwood <!-- (unregistered) in reply to Fred
    Fred:
    Matt Westwood:
    Fred:
    Larry:
    What's a "browser"? And which end should I point with?
    If you have a good sturdy pen on your desk, that can be a browser. Hold the sharp end pointing toward your chest, near your heart. Then run down the hall until you collide with the wall at the end.

    I just tried that. It went right through to the other side and made an unsightly blue mark on the back of my shirt. I demand that you PayPal me the cost of a new shirt.

    No problem Matt. I don't have PayPal installed on my computer though, so post your bank website ID and password and I'll deposit the money direct. (Use white text so other people don't notice.) How much do you want? Be sure to allow for your time going to the store for a new shirt. I'm not a cheap bastard.

    Bank name: WTF Bank, Inc. Bank account #: 12345 Account password: Hunter2 Deposit $20, please!

  • Jim (unregistered) in reply to Doozerboy
    Doozerboy:
    I seriously hope you're trolling
    I'd be guessing someone calling themselves "Devil's Advocate" might...nevermind.

    Manuel: Wit Nit? What is Wit Nit?

  • valetudo (unregistered) in reply to Brendan
    Brendan:
    Larry:
    OK... this is finally my chance to learn something on TDWTF... and since my computer doesn't have google installed...

    What are "DRY principles"?

    Probably just an acronym a project manager made up, to make it easy to remember something instead of understanding it.

    Amen!
  • (cs)

    Hmm... in the article below this someone says that Alex has tragically passed away, yet this article was posted by Alex (or his account, at least). WTFs from beyond the grave?

  • Nag-geoff (unregistered) in reply to ObiWayneKenobi
    ObiWayneKenobi:
    Hmm... in the article below this someone says that Alex has tragically passed away, yet this article was posted by Alex (or his account, at least). WTFs from beyond the grave?

    ObiWayneKenobi, I am convinced you're trolling. Here's a bite for you!

  • Simply Zunesis (unregistered) in reply to Mister E.
    Mister E.:
    Upon seeing this portrait, I'm filled with such mixed feelings. On the one hand, simple empathy for the child - I hope everything turned out alright!

    On the other, all the twisted, but amusing and arousing thoughts that crop up. What the kid's dead and that's hoe they frame the advertisement: "We wanted to care for this kid, but didn't have the money, so we ground him up and fed him to the other kids". Something about this inhumanity actually gives me this vague calm, as I no longer feel the need to care for anyone or anything. There's a whole 'nother world out there - a gateway to it is no larger than the eye of a needle and resides in the back of my mind.

    I imagine myself in a plain dirt field, a soft, cool breeze, at night, just me and the child. I take a rock and start by smashing it's limbs (the poor dear) and then move on to the more vital organs. At climax, I'm repeating smashing the reddish goo that is what's left of his face, screaming out the name my ex-wife and I had chosen for our expected, before the miscarriage and subsequent divorce. I guess she just couldn't stand the sight of me after my cold feet caused me to perform an improvised "procedure" on her one night. At the time, I wasn't sure if I was ready to be a mom.

    "Timmy! Timmy! Timmy! Why were you never born, Timmy!"

    Each time I bring down the stone, I become just a bit less human, until I have no more soul than the stone itself or the lifeless mass crushed into the dirt. Who am I now? Why do I go on living?

    "No! Timmy! Just stay Dead! Die! Die! Die! Timmy! Timmy, I'm sor-or-or-rry!"

    Two sides to me, feeding off of each other. The hateful one giving the human one something to regret and the human one providing the hateful one something to try to escape. I realize now that all logic is ultimately circular in this fashion. My motivation drives my actions and my actions allow me to sustain myself to feel my motivation. Love becomes hate, becomes death, becomes death, becomes death, becomes death...

    Even a perfect circle can only be traced for so long.

    "Fuck you, Timmy! Timmy! Timmy, I'll join so soon, I swear! We can be rotten piles of shit together!"

  • (cs) in reply to Fred
    Fred:
    Matt Westwood:
    Fred:
    Larry:
    What's a "browser"? And which end should I point with?
    If you have a good sturdy pen on your desk, that can be a browser. Hold the sharp end pointing toward your chest, near your heart. Then run down the hall until you collide with the wall at the end.

    I just tried that. It went right through to the other side and made an unsightly blue mark on the back of my shirt. I demand that you PayPal me the cost of a new shirt.

    No problem Matt. I don't have PayPal installed on my computer though, so post your bank website ID and password and I'll deposit the money direct. (Use white text so other people don't notice.) How much do you want? Be sure to allow for your time going to the store for a new shirt. I'm not a cheap bastard.

    Okay, here you are:

    Can I have $2 please? There's one costing £1.50 in the charity shop next door to where I work that looks like it might fit.

  • (cs) in reply to Simply Zunesis
    Simply Zunesis:
    Mister E.:
    Upon seeing this portrait, I'm filled with such mixed feelings. On the one hand, simple empathy for the child - I hope everything turned out alright!

    On the other, all the twisted, but amusing and arousing thoughts that crop up. What the kid's dead and that's hoe they frame the advertisement: "We wanted to care for this kid, but didn't have the money, so we ground him up and fed him to the other kids". Something about this inhumanity actually gives me this vague calm, as I no longer feel the need to care for anyone or anything. There's a whole 'nother world out there - a gateway to it is no larger than the eye of a needle and resides in the back of my mind.

    I imagine myself in a plain dirt field, a soft, cool breeze, at night, just me and the child. I take a rock and start by smashing it's limbs (the poor dear) and then move on to the more vital organs. At climax, I'm repeating smashing the reddish goo that is what's left of his face, screaming out the name my ex-wife and I had chosen for our expected, before the miscarriage and subsequent divorce. I guess she just couldn't stand the sight of me after my cold feet caused me to perform an improvised "procedure" on her one night. At the time, I wasn't sure if I was ready to be a mom.

    "Timmy! Timmy! Timmy! Why were you never born, Timmy!"

    Each time I bring down the stone, I become just a bit less human, until I have no more soul than the stone itself or the lifeless mass crushed into the dirt. Who am I now? Why do I go on living?

    "No! Timmy! Just stay Dead! Die! Die! Die! Timmy! Timmy, I'm sor-or-or-rry!"

    Two sides to me, feeding off of each other. The hateful one giving the human one something to regret and the human one providing the hateful one something to try to escape. I realize now that all logic is ultimately circular in this fashion. My motivation drives my actions and my actions allow me to sustain myself to feel my motivation. Love becomes hate, becomes death, becomes death, becomes death, becomes death...

    Even a perfect circle can only be traced for so long.

    "Fuck you, Timmy! Timmy! Timmy, I'll join so soon, I swear! We can be rotten piles of shit together!"

    My first thought was: Poor kid. Some rotten bastard's shoved some plastic up its nose.

  • (cs) in reply to frits
    frits:
    Inb4 thread degenerates into a discussion about trolling...
    And there you have it. Still, I'm surprised - it took more than 7 hours for anyone else to use the word "troll", even with your prediction. Seems like "troll" usually appears in the first 7 minutes.
  • (cs)

    If I ever feel like hearing about yet another guy copying & pasting stuff yet again, I'll make sure I visit the front page. Until then, I'll stick to the sidebar, where some original content can be found.

  • ¯\(°_o)/¯ I DUNNO LOL (unregistered)

    Hmm... type a period. Um, yeah, why is it letting me enter a decimal point into a quantity field?

    Type a minus sign. Nope, it just allows [0-9.] in there. Hmm, copy a minus sign into the clipboard and right-click paste. Yep, now I can enter -99 quantity. Copy the -99 and paste into every field.

    Total amount: -168438.6 (obviously they haven't heard of fixed decimal places either), less six dollars shipping. And that's without hacking the price fields that it trusts the web browser to send back unmolsted.

    Brillant.

  • sagaciter (unregistered) in reply to foo
    foo:
    StJohn:
    Could be this site

    PMH Foundation

    http://www.pmhfoundation.com/shop/default.aspx

    Seems Josiah put in a loop now. What a fool! Don't break what's working, amirite? (But at least he kept the original code, commented out, in case we want it back instead of his ivory tower fancy loops.)
    Seems they ran out of HushCD9's

  • Luiz Felipe (unregistered)

    I refuse to call this crap a "program" or "script". And i refuse to call the people that writed that crap as a programmer.

  • Luiz Felipe (unregistered)

    I refuse to call this crap a "program" or "script". And i refuse to call the people that writed that crap as a programmer.

  • sMorier (unregistered) in reply to Nag-geoff
    Nag-geoff:
    brodie:
    Wow.... so, I am in no way an "expert" or "senior" programmer, but this is really bad. How can anyone working on commercial, production code not understand something as simple as loops?

    Loops on their own are pretty much useless. This code needs a total revamp before it can be taken up for testing. I pity the fools who are having to maintain this code. Sadly in the 1990's any fool who could type was qualified to be a computer programmer. Apple had a test where they showed three devices and if you correctly identified the computer, you got a job. In those days' nobody wanted to work with Apple, IBM being the employer of choice.

    Of course the trick was that all of the Apple devices were computers of some sort - even the pen and the mouse-pad

  • Simon (unregistered) in reply to boog
    boog:
    J.:
    ... The prices are in the form?
    Sure. How else will Javascript access the prices in order to compute the subtotal in the cart? It's only a problem if the site POSTs the WTF-computed subtotal (instead of computing it on the back end with the real prices). Which wouldn't surprise me.

    Yup, nothing wrong with implementing the cart logic client-side - as long as when it comes time to send the order to the server, the server cares only about the items and quantities, not about prices.

  • Viler (unregistered) in reply to Doozerboy
    Doozerboy:
    Just wondering why the web designers don't list PMH foundation as part of their portfolio....

    http://www.perth-web-design.net.au/website-design-portfolio/

    On the other hand, Sara.... Hell yeah.

    http://www.perth-web-design.net.au/about-perth-web-design/meet-the-perth-web-design-team/#Sara

    Mate - lucky the boss isn't up himself...Not sure whether there was any more room to put "Perth Web Design" in the description of himself...

    Must say, I don't know about "experience in Search Engine Optimisation" necessarily, but he'll be getting a bit of traffic to his site at the moment - he must be doing a good job...

  • Zombie Timmy (unregistered) in reply to Simply Zunesis
    Simply Zunesis:
    Mister E.:
    Upon seeing this portrait, I'm filled with such mixed feelings. On the one hand, simple empathy for the child - I hope everything turned out alright!

    On the other, all the twisted, but amusing and arousing thoughts that crop up. What the kid's dead and that's hoe they frame the advertisement: "We wanted to care for this kid, but didn't have the money, so we ground him up and fed him to the other kids". Something about this inhumanity actually gives me this vague calm, as I no longer feel the need to care for anyone or anything. There's a whole 'nother world out there - a gateway to it is no larger than the eye of a needle and resides in the back of my mind.

    I imagine myself in a plain dirt field, a soft, cool breeze, at night, just me and the child. I take a rock and start by smashing it's limbs (the poor dear) and then move on to the more vital organs. At climax, I'm repeating smashing the reddish goo that is what's left of his face, screaming out the name my ex-wife and I had chosen for our expected, before the miscarriage and subsequent divorce. I guess she just couldn't stand the sight of me after my cold feet caused me to perform an improvised "procedure" on her one night. At the time, I wasn't sure if I was ready to be a mom.

    "Timmy! Timmy! Timmy! Why were you never born, Timmy!"

    Each time I bring down the stone, I become just a bit less human, until I have no more soul than the stone itself or the lifeless mass crushed into the dirt. Who am I now? Why do I go on living?

    "No! Timmy! Just stay Dead! Die! Die! Die! Timmy! Timmy, I'm sor-or-or-rry!"

    Two sides to me, feeding off of each other. The hateful one giving the human one something to regret and the human one providing the hateful one something to try to escape. I realize now that all logic is ultimately circular in this fashion. My motivation drives my actions and my actions allow me to sustain myself to feel my motivation. Love becomes hate, becomes death, becomes death, becomes death, becomes death...

    Even a perfect circle can only be traced for so long.

    "Fuck you, Timmy! Timmy! Timmy, I'll join so soon, I swear! We can be rotten piles of shit together!"

    He remembers me!!!

  • Control C, Control V (unregistered)

    If I ever feel like hearing about yet another guy copying & pasting stuff yet again, I'll make sure I visit the front page. Until then, I'll stick to the sidebar, where some original content can be found.

  • Leif (unregistered)

    I thought that a real Web shopping cart would keep the items in a database. But then you're of course vulnerable to SQL injection and all that shit.

  • foo (unregistered) in reply to David Mårtensson
    David Mårtensson:
    10 years ago I wrote one in JS myself mostly because the server we used to run on was a bit on the week side.
    Sure. I mean 2-3 days response time is acceptable, but a week is a bit much.
  • SG_01 (unregistered) in reply to Andrew
    Andrew:
    StJohn:
    Could be this site

    PMH Foundation

    http://www.pmhfoundation.com/shop/default.aspx

    I think I just puked in my mouth a little bit.

    .... javascript: document.getElementsByName('PMHFSupporterPack')[0].onkeypress = null; .... Type in -5 in the field...

    Hey they'll send me $100 :D And apparently the shop form is totally happy with charging me -$100. (For the record: No I did not actually put in any details to try if they'd actually send me money through that)

  • (cs)

    Zero understanding of arrays. Zero understanding of subroutines. Maintenance: Horrendous.

  • bob (unregistered)

    Well the site was written by Australians, what do you expect?

  • (cs) in reply to bob
    bob:
    Well the site was written by Australians, what do you expect?

    Please show a little sensitivity. I live in a country from which many of the inhabitants of Australia trace their ancestry, and let me assure you, to have a legacy like that is no laughing matter.

  • a highly-placed source (unregistered) in reply to StJohn
    StJohn:
    Is this site

    PMH Foundation

    http://www.pmhfoundation.com/shop/default.aspx

    FTFY.

    For added visibility, all the images link to js.popup of the same image. NB: Only work where smaller versions of things are somehow more visible than the thing itself.

    "href="javascript:OpenWindow('http://www pmhfoundation com/Shop/Shop%2BPhotos/Hush_Vol2.jpg',250,250)">[image]"

  • (cs) in reply to boog
    boog:
    StJohn:
    Could be this site

    PMH Foundation

    http://www.pmhfoundation.com/shop/default.aspx

    Wow. With the same form field names and everything. I thought they anonymized stuff around here.

    They did: the children's hospital form lists "DadsNutsGiftPack" as an item.

  • Jurgen (unregistered)

    We've got the same on our project. But the correct terminology is not WET (Write Everything Twice), it's WETT-WETT-WETT (Write Everything Three Times).

  • MarkW (unregistered) in reply to David Mårtensson
    David Mårtensson:
    the server we used to run on was a bit on the week side.
    You have my sympathy. We had a server that was fortnight.
  • L. (unregistered) in reply to David Mårtensson
    David Mårtensson:
    Peter:
    So... and the cart logic was in Javascript? At least I hope it was just for presentation purposes... but somehow I don't think that's the case

    Writing the cart in JS is not a bad idea as long as you have the checkout serverside along with verifications.

    10 years ago I wrote one in JS myself mostly because the server we used to run on was a bit on the week side.

    Using a JS cart saved on calls to the server as only new pages and checkout ran on the server.

    We handled ~1000 simultaneous shoppers on that server which was an P2 or something like that ;)

    But id did have it's drawbacks of cause, like loosing the cart if you hit F5 (it was before I learned to handle cookies) but customers was satisfied anyway, out site was faster than most other carts :D

    /agree

    anyone thinking duplicating the checking on front-end / back-end is a bad idea ... is dumb.

    Just face it, if you actually think that designing a cart for maximum number of requests is smart .. you should shoot yourself right now.

    Yes, it's not fun or stylish to have part of the logic duplicated, but until you alter the laws of physics to make an extra request "not an issue", you are just dead wrong.

    Just ... for one second ... consider the reality we live in, where many people have over 100ms ping . you want to add 200+ms to your user experience (and server load) for every add to cart ?? - seriously. l2c nub

  • geoffrey (unregistered)

    Even I can't defend this.

  • (cs) in reply to QJo
    QJo:
    bob:
    Well the site was written by Australians, what do you expect?

    Please show a little sensitivity. I live in a country from which many of the inhabitants of Australia trace their ancestry, and let me assure you, to have a legacy like that is no laughing matter.

    Yeah, but you guys didn't want them. You (legally) murdered kids and sent them packing for the crime of being poor.

    Unless you're saying you're from India...

  • tehR (unregistered) in reply to LegacyCrono
    LegacyCrono:
    Larry:
    OK... this is finally my chance to learn something on TDWTF... and since my computer doesn't have google installed...

    What are "DRY principles"?

    • Do it yourself
    • Run Ycursively?
    what.

    When you install the Internet on your computer you need to be sure to download all the software updates, one of which being The Google. He just needs to set his automatic updates.

  • Zekses (unregistered)

    Javascript loops give lack of flexibility, more costly evolution, inhibit the use of the database acting as a service to applications and make it an inhibitor to evolution.

  • (cs) in reply to Zekses
    Zekses:
    Javascript loops give lack of flexibility, more costly evolution, inhibit the use of the database acting as a service to applications and make it an inhibitor to evolution.

    Have you use jquery? Just making some comment with no substence behind is sign of stupid.

  • NotNagesh (unregistered) in reply to Nagesh
    Nagesh:
    I don't believe for this story to be real. How did code pass QA and review?

    You must be new here.

  • Jay (unregistered) in reply to Nagesh
    Nagesh:
    I don't believe for this story to be real. How did code pass QA and review?

    I assume this is just trolling. If not, then if I'm ever accused of a crime, I want Nagesh to be the judge at my trial. "How could this man possibly have robbed a bank, when robbing banks is against the law? I just can't believe that someone would break a law that's clearly written on a piece of paper. Besides, he plainly told us that he didn't do it."

  • (cs) in reply to ¯\(°_o)/¯ I DUNNO LOL
    Nagesh:
    I don't believe for this story to be real. How did code pass QA and review?
    ¯\(°_o)/¯ I DUNNO LOL:
    Hmm... type a period. Um, yeah, why is it letting me enter a decimal point into a quantity field?

    Type a minus sign. Nope, it just allows [0-9.] in there. Hmm, copy a minus sign into the clipboard and right-click paste. Yep, now I can enter -99 quantity. Copy the -99 and paste into every field.

    Total amount: -168438.6 (obviously they haven't heard of fixed decimal places either), less six dollars shipping. And that's without hacking the price fields that it trusts the web browser to send back unmolsted.

    Brillant.

    To me it seems they have found a cheap and effective way to outsource QA and review.

    Seems they are quite fundamentalist followers of the Worse-is-better-process!

  • (cs) in reply to tehR
    tehR:
    When you install the Internet on your computer you need to be sure to download all the software updates, one of which being The Google. He just needs to set his automatic updates.
    And make sure you have a recent drive installed with enough space on it: [image]

Leave a comment on “The WET Cart”

Log In or post as a guest

Replying to comment #:

« Return to Article