• henk (unregistered)

    Wow.... that story made my heart hurt.... Oh and FRIST!

  • Brn (unregistered)

    Very nice. We all have these stories...

    Captcha: damnum.

  • Mordred (unregistered)

    A true pioneer. Hell, if it weren't for IT Monkeys like yourself, we wouldnt even have an internet.

  • Pete (unregistered)

    I know sometimes I look back at old code and think who wrote this crap then realize it was me. The thing with programming is you are always learning and starting with hideous mistakes makes you learn better ways quickly.

  • AnthonyC (unregistered)

    "Not surprisingly, this lead to a few situations where one user would strangely get items in their shopping cart they didn't select..."

    That is surprising... I would have expected situations where two users get unwanted items in their cart.

  • Stan (unregistered)

    Guessing you were the precursor to V.ia.gra sites. Herbal highs perhaps?

  • XZ (unregistered)

    Just brilliant.

  • (cs) in reply to Mordred
    Mordred:
    A true pioneer. Hell, if it weren't for senators and vice presidents, we wouldnt even have an internet.
    FTFY
  • n_a (unregistered)

    Oh, the sweet ache of using RDBs the way Codd never intended us to!..

  • Skilldrick (unregistered)

    This reminds me so much of myself from the days before I decided to learn to program, when I was just throwing together random bits of PHP and MySQL until they worked. Ewwww.

  • (cs) in reply to amischiefr
    amischiefr:
    Mordred:
    A true pioneer. Hell, if it weren't for senators and vice presidents, we wouldnt even have an internet.
    FTFY
    Well, Al Gore did "build" the internet, buy pushing the funding of infrastructure through the US congress and senate, etc. Note: I did not say "invent the internet" (which he has never claimed).
  • (cs)

    The thing is.. there's nothing wrong with writing WTFy code if you learn from your mistakes and improve. Yes, the code is a WTF and we all point and laugh, but everyone has to start somewhere; you start by writing bad code and then improve later on as you learn WHY it's bad code, and what would make it GOOD code.

    The problem with many "developers" is that they write the WTFy code and it works, so they never bother to improve or think "Wow that code reeks, but I had such a tight deadline I couldn't do it right, I'll learn how to do it better for the next time"

  • NoAstronomer (unregistered)

    "But hey, that was their fault for not starting at the right place."

    I've had a co-developer actually tell me this in a design session.

  • Bob (unregistered)

    That reminds me of some BASIC-with-lots-of-hex-codes-and-a-poke-loop program I typed in from Amstrad Action back in the 80s for my CPC 464. I think it was supposed to play random Mozart minuets. I couldn't get it to work. I tried for days and days, but got stuck on this line (or something like it):

    1100 LET X = HIMEN

    Years later (the 90s, the above having been deeply engrained in my memory) I was setting up some extended (expanded?) memory for Windows 3 with "HIMEM.SYS" and I realised that I had made a Freudian spelling error (phonetically, at least) years before in my BASIC program and long before I knew what one was.

    I cringed a bit at the thoughts of my mother, a midwife, trying to understand why her son (13) was wandering about the house for a week muttering about his "hymen problem". She never asked for details; she just told me it would probably come good in the end, though it never did.

  • Jim (unregistered)

    That is hands down the best submission I have ever had the pleasure to read on this site.

    I love the way you explained the logic behind each hideous step. I doubt there is a developer here who you haven't given uncomfortable flashbacks to days when they made exactly those kinds of well meaning but totally misguided decisions.

  • Half Way (unregistered)

    AAAAAAaa!!! I'm half way through and already pounding my face with my fist.

    Does it have a happy ending?

  • Anonymous (unregistered)

    Lots of dumb design decisions there but at least you learnt from your mistakes. Some people code like that for their entire lives.

  • Ben (unregistered)

    'bad practice to use the back button anyway'

    I totally agree, if something is difficult to implement or would break some other functionality, flash an enormous error message telling the user it's their fault. Though it does mean you get more support phone calls, but if you're not the one answering them, who cares?

  • Mister Zimbu (unregistered)
    After a few more years a total cowboy programmer, I have since reformed my ways.

    Good to hear. Now you realize that making new tables named CART1, CART2, CART3, etc. is bad practice.

    This is of course because the table names are too predictable and a security risk as such. You should instead have more randomized cart names such as CART-DF2081F6-7C9C-44F6-90E2-14775DE648E6-568FECA1-567C-4DF1-876F-C18810E8D85B.

  • ametblopet (unregistered)

    This isn't such a huge WTF. My first foray into web development included leaving on magic_quotes (although despite this there were no injects) and having a table per forum thread with the id as part of the name as well. 95% of the code was also packed into a single file. This was a personal project. A good programmer iteratively improves and after a single terrible project with some questionable approached to accomplish various objectives I was largely using good practices and had eliminated all major WTFs.

    I start of in a similar place to you except with a little more academic experience. I had also successfully typed programs into my CPC.

    Some people take one iteration to get up to spec, some two, some get it right first time. The worrying thing is when you outsource to an agency that subscribes to the label "professional" and has staff that literally have years experience yet returns first iteration quality code (as if it were the first time their coders were using the language). I've seen many a programmer old enough to be senior exhibit the same lack of quality.

    So there's no big deal about you making a big mess at your first try as long as you're still not doing it. That would be a major WTF were it not the norm.

  • Half Way (unregistered) in reply to Half Way
    Half Way:
    AAAAAAaa!!! I'm half way through and already pounding my face with my fist.

    Does it have a happy ending?

    Whew!

  • remi bourgarel (unregistered)

    This kind of situation happens mostly when you're the only developer and you think you're good because you have the expected results.

    Hopefully the company is out of business : can you imagine the face of an other developer trying to debug all this piece of WTF.

  • Vexi (unregistered)

    So that guy is responsible for all the shopping cart mess! I hope he's not currently employed at DiscountKoalaMeat.com

    Captcha: immitto. I'n alreay on it (tomorrow)

  • Anonymous (unregistered)
    The Article:
    After a few more years a total cowboy programmer...
    It took you years to improve as a programmer? So are you a hardware guy or what? It shouldn't take a good coder mutliple years of industry experience to figure out basics like how to properly structure a DB for a trivial shopping cart app. I trust that programming was a secondary skill and not your main line of work?
  • (cs) in reply to remi bourgarel
    remi bourgarel:
    ... because you have the expected results.

    Yeah, the pats on the back help turning the blind eye on the BS that is scattered around it or used to hold things together.

  • frits (unregistered) in reply to Jim
    Jim:
    I doubt there is a developer here who you haven't given uncomfortable flashbacks to days when they made exactly those kinds of well meaning but totally misguided decisions.
    In other words, who hasn't done something like this?
  • Artemis (unregistered)

    I've already seen it before...

    (Unfortunaly, it's in - bad - portuguese. Even google translator is unable to understand it). http://www.guj.com.br/java/212287-metodos/1

  • The Corrector (unregistered) in reply to Mordred
    Mordred:
    A true pioneer. Hell, if it weren't for IT Monkeys like yourself, we wouldnt even have an internet this website.
    FTFY
  • Neil (unregistered)

    It wasn't for a shopping cart, but I once worked around the URL-based tracking problem by turning everything into a POST request, so there were no links, everything was actually done via <input type="image">. Of course, the real WTF was designing the thing in FrontPage in the first place.

  • TRWTF is You (unregistered) in reply to Pete
    Pete:
    I know sometimes I look back at old code and think who wrote this crap then realize it was me. The thing with programming is you are always learning and starting with hideous mistakes makes you learn better ways quickly.
    That's why most universities offer a computer science degree. You spend four years learning how to code properly so that when you hit the workforce you can undo the damage of uneducated morons.

    Kudos to the submitter for admitting his mistake, but not to all the jackwagons advocating them.

  • (cs) in reply to Code Slave
    Code Slave:
    amischiefr:
    Mordred:
    A true pioneer. Hell, if it weren't for senators and vice presidents, we wouldnt even have an internet.
    FTFY
    Well, Al Gore did "build" the internet, buy pushing the funding of infrastructure through the US congress and senate, etc. Note: I did not say "invent the internet" (which he has never claimed).
    During my service in the United States Congress, I took the initiative in creating the Internet
    http://en.wikipedia.org/wiki/Al_Gore#Second_presidential_run_.282000.29

    And sure, argue semantics about whether or not create = invent, but Gore did neither.

  • Joe (unregistered)
    Article:
    when judging others work, I shouldn't be the one to throw the first stone.
    No, don't throw the first stone. Post it to TDWTF, and let us throw the first. And the second. And the third. And the stones thrown at a spelling mistake on the second throw. And the grammar error in that stone. Then you can take your turn throwing your stone.

    --Joe

  • (cs) in reply to Neil
    Brian F:
    The homepage of the website would create a new table for each customer
    Okay, that's a strong start, I'll grant you that. But let's see if you can bring the *real* heat.
    Brian F:
    Therefore, for security purposes, I decided that this id should change after every click.
    (applause) Congratulations, you have graduated summa cum larte from BOFH University.
  • BentFranklin (unregistered) in reply to Half Way
    Half Way:
    AAAAAAaa!!! I'm half way through and already pounding my face with my fist.

    Does it have a happy ending?

    If you want a happy ending, try pounding a little lower.

  • LANMind (unregistered) in reply to ObiWayneKenobi
    ObiWayneKenobi:
    you start by writing bad code and then improve later on as you learn WHY it's bad code
    Is that boilerplate from the Agile manifesto?
  • Ralph (unregistered)

    It seems that every third website I visit has me cursing the developers because I can "hear" them thinking exactly what you were thinking:

    • Everyone's computer will be exactly like mine.

    • Users will obediently follow the path I laid down for them.

    • Screw the URL highlighting that shows people which pages they've visited and which ones are new.

    • We don't want any customers from search engines; we'll do it all with advertising.

    • If you don't use IE, and click "OK" on every security warning, and, and, and... we don't want your stinkin money. Go somewhere else.

    Oh, and as for the back button, even the big boys are determined to break that now. Google, Oracle... pretty much every AJAX site (phtooey)...

  • pjt33 (unregistered) in reply to TRWTF is You
    TRWTF is You:
    That's why most universities offer a computer science degree. You spend four years learning how to code properly so that when you hit the workforce you can undo the damage of uneducated morons.
    Doesn't sound like they're actually learning computer science. I read a *real* CS degree and graduated knowing six normal forms but no SQL syntax.
  • CameByItHonestly (unregistered) in reply to TRWTF is You

    The number of WTF's I've seen from comp sci degree holding know-it-alls is staggering. I'm not even talking "creative" development, but some serious base level stuff, like complete ignorance of constructors, secret-decoder ring "encryption" schemes, and pretty much anything to do with OO design and development. And then there are the graduates who think because they learned it in school it must be applied to everything. But I'm just an uneducated moron, so don't take it from me.

  • Joe (unregistered) in reply to Ralph
    Ralph:
    Oh, and as for the back button, even the big boys are determined to break that now. Google, Oracle... pretty much every AJAX site (phtooey)...

    Yes, those sites break the back button, but they're not as Evil as the ones who have replaced their website with a single Flash object. coughOracleSupportcough

    --Joe

  • Anon (unregistered) in reply to Code Slave
    Code Slave:
    amischiefr:
    Mordred:
    A true pioneer. Hell, if it weren't for senators and vice presidents, we wouldnt even have an internet.
    FTFY
    Well, Al Gore did "build" the internet, buy pushing the funding of infrastructure through the US congress and senate, etc. Note: I did not say "invent the internet" (which he has never claimed).

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

    Al Gore deserves a ton of credit for the Internet you use today.

  • (cs)

    It's disturbing how so many comments suggest that "making mistakes" is the best way to learn. If your method of learning new technology is to crash and burn and get it right the second time around, I don't think I'd ever want to hire you.

    "Wise men learn by other men's mistakes, fools by their own."

  • Warren (unregistered)

    Design flaw identified. Instead of a whole table for the shopping cart all you need is a column in the products table "number in cart".

    Now, of course you need one of these columns for each user....

  • Fred (unregistered)

    My computer science courses seemed to be obsessed with binary logic -- how to squeeze two more bits out of the chip you're designing for the next cell phone -- rather than how to write software for normal businesses. Except for the esoteric theories, my professors were about the most computer illiterate people I ever worked with.

    We had an assignment to write a "system" for a hypothetical customer-facing business. There were to be four data entry screens. (No output, just entry -- and it was a good thing there was no output, because there was no database.) Professor required each screen to be implemented as a single, separate Java class. 100% procedural code inside the class, of course. This was a Masters' level course.

    Another whole course was on data warehousing (hey at least they'd heard of data). Not that we ever touched a DW. Just spent the whole semester discussing how lovely they would be, if we ever saw one.

  • A Gould (unregistered) in reply to Anonymous
    Anonymous:
    The Article:
    After a few more years a total cowboy programmer...
    It took you years to improve as a programmer? So are you a hardware guy or what? It shouldn't take a good coder mutliple years of industry experience to figure out basics like how to properly structure a DB for a trivial shopping cart app. I trust that programming was a secondary skill and not your main line of work?

    You forget one of the key rules of building.. well, anything: if it works, but it's ugly, it still works.

    In my mind, this is a perfect example of Worse Than Failure - if it had crashed and burned, he would have learned something. Since it "worked", there's no impetus for the boss to let you fix/improve it until Karma calls, which means that you're not going to figure out what you did wrong (again, until Karma shows you.)

  • JuanCarlosII (unregistered) in reply to Ralph
    Ralph:
    * If you don't use IE... we don't want your stinkin money. Go somewhere else.

    To be fair, these days the opposite is more likely.

  • Ralph (unregistered) in reply to Joe
    Joe:
    Yes, those sites break the back button, but they're not as Evil as the ones who have replaced their website with a single Flash object. *cough*OracleSupport*cough*

    --Joe

    Oh, yes, the ones that make me think we should lobby for certain exceptions for justifiable homicide.

    By the way, thanks, Al Gore, for this mess. I think we're approaching the time to scrap the whole thing and start over.

  • (cs) in reply to TRWTF is You
    TRWTF is You:
    That's why most universities offer a computer science degree. You spend four years learning how to code properly so that when you hit the workforce you can undo the damage of uneducated morons.

    Kudos to the submitter for admitting his mistake, but not to all the jackwagons advocating them.

    Yeah... because a four-year computer science degree means that you know how to code properly. Right.

  • Anon (unregistered) in reply to strictnein
    strictnein:
    Code Slave:
    amischiefr:
    Mordred:
    A true pioneer. Hell, if it weren't for senators and vice presidents, we wouldnt even have an internet.
    FTFY
    Well, Al Gore did "build" the internet, buy pushing the funding of infrastructure through the US congress and senate, etc. Note: I did not say "invent the internet" (which he has never claimed).
    During my service in the United States Congress, I took the initiative in creating the Internet
    http://en.wikipedia.org/wiki/Al_Gore#Second_presidential_run_.282000.29

    And sure, argue semantics about whether or not create = invent, but Gore did neither.

    Read more... Al Gore pushed through tons of legislation that made the Internet possible, specifically...

    the High Performance Computing and Communication Act of 1991, which is also known as “The Gore Bill”. Gore originally started crafting this bill in 1988 after hearing a report “Toward a National Research Network”, which was submitted to congress by a group of UCLA computer science professors, including Leonard Kleinrock who was one of the original creators of the ARPANET, the predecessor to the Internet.

    Gore’s bill eventually passed on December 9, 1991 and led to, among a lot of other things that contributed to the growth and creation of the Internet, the National Information Infrastructure (NII), which Gore referred to as the “Information Superhighway”. Basically, this was a proposed “advanced, seamless web of public and private communication networks, interactive services, interoperable hardware and software, computers, databases, and consumer electronics to put vast amounts of information at users’ fingertips.”

    This bill also ended up resulting in providing funding to Marc Andreessen, the inventor of the Mosaic Web Browser.

    There were 300,000 computers on the Internet in 1990, 10 million by 1996... Al Gore was a huge early champion of the Internet, and really deserves some respect from us IT people... (not talking politics... doesn't matter what his politics are - he was the biggest proponent of the Internet in Congress in the 80s and 90s...)

    During that unfortunate interview, he was just touting some of his actual accomplishments...

  • (cs) in reply to CameByItHonestly
    CameByItHonestly:
    The number of WTF's I've seen from comp sci degree holding know-it-alls is staggering. ... And then there are the graduates who think because they learned it in school it must be applied to everything.

    /agree with that... I've spent way too much time unwinding some young-uns glorious coding opus because the performance flowed like molasses in winter.

    A Peer Review is an indispensable tool, as well as a dish best served cold, since you may be supporting that code in the future.

  • (cs) in reply to boog
    boog:
    It's disturbing how so many comments suggest that "making mistakes" is the best way to learn. If your method of learning new technology is to crash and burn and get it right the second time around, I don't think I'd ever want to hire you.

    "Wise men learn by other men's mistakes, fools by their own."

    "Build one to throw away."

    -- Fred Brooks, The Mythical Man-Month

Leave a comment on “Confessions: The Shopping Cart”

Log In or post as a guest

Replying to comment #:

« Return to Article