• brodie (unregistered)

    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?

  • sehe (unregistered) in reply to brodie
    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?

    You forgot the FRIST!

  • Peter (unregistered)

    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

  • sehe (unregistered) in reply to brodie
    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?

    Also, who said he didn't understand loops? He knows about them. Strange loops too. Also, he consulted the documentation for his CPU architecture and he concluded that a loop would be bad for throughput due the increased branching.

    The data would be prefectched so everything is optimal.

    [Sic]

  • Lost (unregistered)

    By only working on enterprisy software ?

    ooh, and thrid!!!

  • cguy (unregistered)

    All about the loop unrolling. Efficent code!

  • (cs)

    This reminds me of code I once wrote back in the 10th grade. However in that same year I discovered something called the while loop and then I quickly learned about for loops.

  • TheRon (unregistered)

    Item value as float? WTF?

  • anonymous (unregistered) in reply to sehe
    sehe:
    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?

    You forgot the FRIST!

    That's why he's not at a senior level.

  • Aris (unregistered)

    +10 pts for writing business-logic and security code in client-side.

    I hope the code is doubled (making it really WET) in the asp/jsp/php part.

  • (cs)

    What's all this nonsense about DRY? Each of those lines is clearly unique.

  • Zapp Brannigan (unregistered)

    You need both loops and arrays. This explains why 4 out my 80 nieces and nephews were disappointed last Xmas.

  • Bill (unregistered)

    Thirteenth comment!

    Fourteenth comment!

    Fifteenth comment!

  • DonaldK (unregistered)

    The programmer was obviously paid by lines of code written.

    After 6 months at Amazon he never had to work again.

  • Larry (unregistered)

    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?
  • (cs)

    Inb4 thread degenerates into a discussion about trolling...

  • DRY (unregistered) in reply to Larry

    "don't repeat yourself" is what he's going for.

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

  • J. (unregistered)

    ... The prices are in the form?

  • foo (unregistered) in reply to DRY
    Google:
    "don't repeat yourself" is what he's going for.
    FTFY
  • (cs)

    Is anyone else bothered that the item names are form field names?

    It's just... It's just wrong... So wrong.

  • foo (unregistered) in reply to frits
    frits:
    What's all this nonsense about DRY? Each of those lines is clearly unique.
    The braces lines are not. (Since this is a nit-picking forum, why haven't 10 others pointed this out already?)
  • (cs) in reply to Larry
    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.
  • Lex Luther (unregistered) in reply to boog

    That's not the item names, that's the value. Based on the calculations, he has two fields- quantity and price.

    I need to find out what site this is and back up the truck.

  • (cs) in reply to J.
    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.
  • (cs) in reply to Lex Luther
    Lex Luther:
    That's not the item names, that's the value. Based on the calculations, he has two fields- quantity and price.

    I need to find out what site this is and back up the truck.

    Stitches, FirstAidKit, and Wristband aren't item names? I'm not talking about the values they store.

  • Nick (unregistered) in reply to Peter

    What website uses this? You'd get some really great discounts with a little bit of source dabbling...

  • StJohn (unregistered)

    Could be this site

    PMH Foundation

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

  • My Name Is Missing (unregistered)

    A good job interview set of questions would be to take these examples minus the snarky commentary and see if the candidate realizes how stupid these things are.

    Of course the question is how did this person get the job who wrote this? I guess they already worked there and was given the job "since all programmers are the same".

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

  • (cs) in reply to StJohn
    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.

  • Ken B. (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.
    Google has a virus, so they uninstalled it. Didn't you know that?

    http://clientsfromhell.net/post/13880316592/

  • Ken B. (unregistered) in reply to Anketam
    Anketam:
    This reminds me of code I once wrote back in the 10th grade. However in that same year I discovered something called the while loop and then I quickly learned about for loops.
    Ergo, this was written by a 9th grader.

    Nothing more to see here.

  • (cs)

    Is the other WTF is that you can buy e.g. -1.337 FirstAidKits ? (ParseFloat ...)

  • WTFStalker (unregistered) in reply to foo

    Whew. At least the old code was replaced by some jquery. Too bad the old crufty stuff was just commented out. Perhaps it was just for our amusement.

  • (cs)
    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.
  • Andrew (unregistered) in reply to StJohn
    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.

  • airdrik (unregistered) in reply to WTFStalker
    WTFStalker:
    Whew. At least the old code was replaced by some jquery. Too bad the old crufty stuff was just commented out. Perhaps it was just for our amusement.
    Or as a warning, kind of like mounting human sculls on posts. Warning: dangerous code lives in these parts!

    It's one thing if you temporarily leave commented code in your source that you intend to remove or uncomment later. Leaving it on the web pages for all the world to see is a whole 'nuther WTF on its own.

    P.S. I like how they had commented out some of the items that were part of the original list (using different commenting styles, no less), but were "removed" before they switched to jquery and commented out the whole blocks. "We might need to re-add those, and copy+paste is so much harder than removing some comment characters, and we might misspell something and everything will blow up."

  • Mister E. (unregistered) in reply to StJohn
    StJohn:
    Could be this site

    PMH Foundation

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

    Awww... That baby is saddened by the code.

    [image]
  • Jack Strikes Back (unregistered) in reply to Mister E.
    Mister E.:
    StJohn:
    Could be this site

    PMH Foundation

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

    Awww... That baby is saddened by this article.

    [image]
    FTFY. BTW, when does the site change its name to "thewheneverthecrapifeellikeitwtf.com?"
  • Up Down (unregistered) in reply to StJohn
    StJohn:
    Could be this site

    PMH Foundation

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

    Yes, hello? I'd like to know why my order of .01 of everything didn't go through.

  • Some damn Yank (unregistered) in reply to Larry
    Larry:
    since my computer doesn't have google installed...
    Well, google is easy to install, you don't even need Administrator or Root access. It's a simple, two step process: 1) Point your browser of choice to www.google.com 2) Bookmark/Favorite the page

    (it would be a three step process except step 3) Profit! is for Google, not you)

  • Larry (unregistered) in reply to Some damn Yank
    Some damn Yank:
    Larry:
    since my computer doesn't have google installed...
    Well, google is easy to install, you don't even need Administrator or Root access. It's a simple, two step process: 1) Point your browser of choice to www.google.com 2) Bookmark/Favorite the page

    (it would be a three step process except step 3) Profit! is for Google, not you)

    What's a "browser"? And which end should I point with?

  • Fred (unregistered) in reply to Larry
    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.
  • c (unregistered) in reply to Ken B.
    Ken B.:
    Google has a virus, so they uninstalled it. Didn't you know that?

    http://clientsfromhell.net/post/13880316592/

    I thought some idiot had ignored all the warnings and typed "Google" into the search.

  • (cs)

    76? What do they sell, gas or boys' bands?

  • Jay (unregistered) in reply to Larry
    Larry:
    ... and since my computer doesn't have google installed...

    I'd like to go get some food, but my car didn't come with grocery stores.

  • ThatCruftyGuyOverThere (unregistered) in reply to mikedjames

    It concerns me that you can checkout with negative quantities...

    What are the chances they will pay me what they owe me....

    caption: inhibeo - Inhibition now in gel form

  • Nag-geoff (unregistered) in reply to brodie
    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.

  • Nag-geoff (unregistered) in reply to Nag-geoff

    Such a legacy of problematic programming that violates good architectural and coding practices is called "technical debt," a metaphor that is gaining broader attention.

    Poor quality code, whether the result of business decisions to cut corners or weak programming skills, may be responsible for a computer system crash, a security breach, poor performance or data corruption, among other things.

    Repairing each line of code has a cost, or technical debt, that accumulates.

Leave a comment on “The WET Cart”

Log In or post as a guest

Replying to comment #:

« Return to Article