Your code is bad and you should feel bad



  • A short one you've probably encountered before: every time there's a bug in code I touched, I get accused of writing bad code.

    WTF?



  • Well ok it's a WTF I guess?



  • You should have complained about the broken state of the code before you touched it.


  • Trolleybus Mechanic

    @configurator said:

    A short one you've probably encountered before: every time there's a bug in code I touched, I get accused of writing bad code.

    WTF?

     

    Oh yeah, just like that time.

     



  • @Lorne Kates said:

    @configurator said:

    A short one you've probably encountered before: every time there's a bug in code I touched, I get accused of writing bad code.

    WTF?

     

    Oh yeah, just like that time.

     

    I can recall


  • @Evilweasil said:

    You should have complained about the broken state of the code before you touched it.

    Sorry, I should have elaborated. It's not about whether or not my code caused the issue or not. My problem is the attitude that if a bug reaches our QA team, someone must be blamed and berated for being a lousy developer and generally a bad person.



  • @Evilweasil said:

    You should have complained about the broken state of the code before you touched it.

    Sorry, I should have elaborated. It's not about whether or not my code caused the issue or not. My problem is the attitude that if a bug reaches our QA team, someone must be blamed and berated for being a lousy developer and generally a bad person.



  • @Evilweasil said:

    You should have complained about the broken state of the code before you touched it.

    Sorry, I should have elaborated. It's not about whether or not my code caused the issue or not. My problem is the attitude that if a bug reaches our QA team, someone must be blamed and berated for being a lousy developer and generally a bad person.



  • @configurator said:

    @Evilweasil said:
    You should have complained about the broken state of the code before you touched it.

    Sorry, I should have elaborated. It's not about whether or not my code caused the issue or not. My problem is the attitude that if a bug reaches our QA team, someone must be blamed and berated for being a lousy developer and generally a bad person.




    Your QA team sucks.


  • Trolleybus Mechanic

    @configurator said:

    @Evilweasil said:
    You should have complained about the broken state of the code before you touched it.

    Sorry, I should have elaborated. It's not about whether or not my code caused the issue or not. My problem is the attitude that if a bug reaches our QA team, someone must be blamed and berated for being a lousy developer and generally a bad person.

     

    Sometimes you have to say the same thing multiple times to be understood.


  • Trolleybus Mechanic

     @configurator said:

    @Evilweasil said:
    You should have complained about the broken state of the code before you touched it.

    Sorry, I should have elaborated. It's not about whether or not my code caused the issue or not. My problem is the attitude that if a bug reaches our QA team, someone must be blamed and berated for being a lousy developer and generally a bad person.

    Sometimes you have to say the same thing multiple times to be understood.


  • Trolleybus Mechanic

    @configurator said:

    @Evilweasil said:
    You should have complained about the broken state of the code before you touched it.

    Sorry, I should have elaborated. It's not about whether or not my code caused the issue or not. My problem is the attitude that if a bug reaches our QA team, someone must be blamed and berated for being a lousy developer and generally a bad person.

     

    Sometimes you have to say the same thing multiple times to be understood.



  • @configurator said:

    Sorry, I should have elaborated. It's not about whether or not my code caused the issue or not. My problem is the attitude that if a bug reaches our QA team, someone must be blamed and berated for being a lousy developer and generally a bad person.

    1. write less sucky code

    2. take bug reports less personally

    3. ???

    4. Profit (and be less of a downer to be around)



  • @configurator said:

    A short one you've probably encountered before: every time there's a bug in code I touched, I get accused of writing bad code.
     

    So it's exactly like being elected to run a country!



  • @configurator said:

    @Evilweasil said:
    You should have complained about the broken state of the code before you touched it.

    Sorry, I should have elaborated. It's not about whether or not my code caused the issue or not. My problem is the attitude that if a bug reaches our QA team, someone must be blamed and berated for being a lousy developer and generally a bad person.

    Who does the blaming and berating? If it's coming from QA, try saying this: "You're absolutely right. The company should fire all the developers and hire people who are competent. Then, we won't need to employ a QA team anymore."



  • @dhromed said:

    @configurator said:

    A short one you've probably encountered before: every time there's a bug in code I touched, I get accused of writing bad code.
     

    So it's exactly like being elected to run a country!

     

    "This president is unacceptable! He's just running up the national debt, spending all of this money that he is legally obligated by Congress to spend, using this tax revenue that he is legally obligated by Congress to collect! A good president wouldn't be having these petty problems like 'mathematical realities' and 'numbers being less than other numbers!'"

    - 90% of all US politics for the past 40 years.

     



  • @curtmack said:

    - 90% of all US politics for the past 40 years.
     

    So you're saying that in the past 40 years there has been exactly 1 president with exactly 1 term under his belt that probably did things right?


  • ♿ (Parody)

    @dhromed said:

    @curtmack said:
    - 90% of all US politics for the past 40 years.

    So you're saying that in the past 40 years there has been exactly 1 president with exactly 1 term under his belt that probably did things right?

    Yeah, I find this confusing, because being a terrible human being is pretty much a requirement want to be elected to any office. Also, I can't understand the 40 years part. It's like politics was all very good-natured and everyone got along great before we were born, or something. Also, our generation clearly invented sex.



  • @dhromed said:

    @curtmack said:

    - 90% of all US politics for the past 40 years.
     

    So you're saying that in the past 40 years there has been exactly 1 president with exactly 1 term under his belt that probably did things right?

     

    I assumed the 90% included every national level position, every state level position, every county/borough/parish level position, and most local positions.

     



  • @configurator said:

    A short one you've probably encountered before: every time there's a bug in code I touched, I get accused of writing bad code.

    WTF?

    I can do you one better: every time it seems like there may be something wrong with one of our products, they will assume I broke it unless I cannot possibly have touched the code. They quickly figure out the cause or culprit, which may or may not be me, but the assumption itself is what I find offensive.


  • @configurator said:

    My problem is the attitude that if a bug reaches our QA team, someone must be blamed and berated for being a lousy developer and generally a bad person.
     

    So unless you've got evidence that the bug existed in a codeblock not touched by you - shut up and put up.

    Alternatively, ask QA how it should have been done.  Start using their blame as a driver for improvement, engage them into explaining better ways. After a bit they may not blame you so loudly if it means they become impromptu teachers at the end of each bug report.



  • @smxlong said:

    "You're absolutely right. The company should fire all the developers and hire people who are competent. Then, we won't need to employ a QA team anymore."
     

    Factually incorrect, but still a good comeback nonetheless. I approve.



  • I usually try to correct any additional glaring problems with any code I touch, even if it's not immediately related to my project (I write up the existing issues, if they weren't already, and then mark them as additional fixes of my development).  I felt very dumb the one time that I failed to do that, and ended up missing a chance to proactively fix something that an angry customer ran into months later.



  •  Just to derail the thread even further past politics, I found this gem in regards to the Australian GST tax (Tax on Luxuries): here

     Edit: Think I just broke everyone's email notifications.

    Edit: New WTF: I copied and pasted that from a Lotus Notes sametime message. Sametime is the IM Lotus Notes brings. It stamps a hidden text element to the clipboard. I can't remove that in the edit option, it doesn't appear at all.

    Edit AGAIN: I got rid of it. To show I'm not a crazy ramble, here's what I'm talking about. Pasting one word from sametime: <style type="text/css"> body { margin: 0 0 0 0; padding:0 0 0 0 } td,div { font-family:Segoe UI;font-size:9pt;vertical-align:top } /* Copyright IBM Corp. 2011 All Rights Reserved. */ body { margin: 0 0 0 0; padding:0 0 0 0; overflow:hidden; } .transcript { background-color:#d2d2d2; } .messageBlock { padding-left:10px; padding-right:10px; margin-bottom:3px } .message { padding-left:20px; margin-left:95px; word-wrap:break-word; white-space:-moz-pre-wrap; _white-space:pre; white-space:pre-wrap;} .messageCont { padding-left:20px; margin-left:95px; word-wrap:break-word; white-space:-moz-pre-wrap; _white-space:pre;white-space:pre-wrap;} .other { font-size:11px;color:#39577a;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .myself { font-size:11px;color:#da8103;font-style:normal;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont { font-size:8px;text-align:right; color:#39577a;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .myselfCont { font-size:8px;text-align:right; color:#da8103;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .system { font-size:11px; word-wrap:break-word;color:#da8103;font-style:normal;font-weight:normal; white-space:-moz-pre-wrap; _white-space:pre;white-space:pre-wrap; } .showTimestamp { padding-left:20px; font-size:11px; float:right; color:#999999;font-style:normal;font-weight:normal; } .other1 { font-size:11px; color:#ac2000;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont1 { font-size:8px;text-align:right; color:#ac2000;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other2 { font-size:11px; color:#3c9fa8;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont2 { font-size:8px;text-align:right; color:#3c9fa8;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other3 { font-size:11px; color:#e25614;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont3 { font-size:8px;text-align:right; color:#e25614;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other4 { font-size:11px; color:#0b6ac8;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont4 { font-size:8px;text-align:right; color:#0b6ac8;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other5 { font-size:11px; color:#b23290;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont5 { font-size:8px;text-align:right; color:#b23290;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other6 { font-size:11px; color:#02e7c7;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont6 { font-size:8px;text-align:right; color:#02e7c7;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other7 { font-size:11px; color:#5b3284;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont7 { font-size:8px;text-align:right; color:#5b3284;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .highlight { background-color:#bed6f8; } .datestamp { padding-right:0px; font-size:11px; cursor:default; margin-bottom:1px; background-color:#c0c0c0; width:100%; float:left; text-align:right; color:#ffffff; font-weight:bold; font-style:italic; } #chatAlert { float:left; border-bottom:1px solid #E8D091; padding:6px; width:100%; color:#A5754C; } #chatAlertImage { float:left; } #chatAlertText { float:left; margin-left:6px; margin-right:10px;} #chatAlertClose { float:right; margin-right:10px; padding-right:6px; margin-top:0px; } #chatAlertText a { color:#A5754C; } #chatAlertText a:hover { color:#A5754C; text-decoration:none; }

    .tsDisplay { display:block }.dsDisplay { display:none }</style>

    Done 

  • Discourse touched me in a no-no place

    @configurator said:

    every time there's a bug in code I touched, I get accused of writing bad code.
    You're better off than I then. I get accused of causing problems in code I haven't been near.


  • Discourse touched me in a no-no place

    @Adanine said:

    Pasting one word from sametime:
    There is still absolutely no content in what you pasted - it's still all formatting. And you somehow removed the original link.



  • Had this happen once; I was asked to look into speeding up a particularly slow CMS. Which, of course, was developed and used extensively by the company I worked for. Upon finding a glaring performance issue, I fix it and notify my manager that there's an update available which should speed up the internal website by a factor four or so. I also warn him that this change fundamentally alters the way data acquisition is performed, and should therefore be tested extensively before deploying to our clients.

    Manager is exalted, demonstrates it to the higher ups, they love not having to wait half a minute for each page reload, and immediately decide to push the change to the internal website.

    Fast forward a few hours, when suddenly the internal website starts to misbehave. Data starts to mismatch, there are tiny discrepancies all over the place, especially in the articles the big boss has been editing. We soon realize that all changes for the past hour or so are corrupt to the point where they can not be salvaged. Boss is pissed, and of course since the only (big) change to the code was my update, managers immediately assume the update was broken. Which, I pointed out, was why I insisted it be tested first. Ah well, we live and learn, and being unable to find the fundamental flaw (keep in mind that this was a huge system, which explains part of the slowness) I essentially start from scratch; rewrite the entire fix from a new perspective which is not as effective, but more controllable.

    Fast forward a few days, when I talk to an intern that does server maintenance. "Ow, yeah, that big mix up! Funny story, turns out I mis-configured one of the database servers! Talk about a laugh, eh!"

    To this day I still do not know whether my original fix actually worked fine or not. It wouldn't surprise me.



  • @FragFrog said:


    Fast forward a few days, when I talk to an intern that does server maintenance. "Ow, yeah, that big mix up! Funny story, turns out I mis-configured one of the database servers! Talk about a laugh, eh!"

    To this day I still do not know whether my original fix actually worked fine or not. It wouldn't surprise me.

    Where did you hide the body?



  • @configurator said:

    @Evilweasil said:
    You should have complained about the broken state of the code before you touched it.

    Sorry, I should have elaborated. It's not about whether or not my code caused the issue or not. My problem is the attitude that if a bug reaches our QA team, someone must be blamed and berated for being a lousy developer and generally a bad person.

    If only there was a way to find who to blame for a particular bit of code.



  • @MiffTheFox said:

    @configurator said:
    @Evilweasil said:
    You should have complained about the broken state of the code before you touched it.

    Sorry, I should have elaborated. It's not about whether or not my code caused the issue or not. My problem is the attitude that if a bug reaches our QA team, someone must be blamed and berated for being a lousy developer and generally a bad person.

    If only there was a way to find who to blame for a particular bit of code.

    ...or praise of course. Unfortunately, no such way exists at my current source of employment.



  • @PJH said:

    I get accused of causing problems in code I haven't been near.
     

    Yeah, but to be fair you curdle milk at 10 paces, so it's understandable they think that way.

    @Evilweasil said:

    Where did you hide the body?

    That would be telling. Would you like a pie?

     



  • @Evilweasil said:

    Where did you hide the body?

    That was my first thought as well.

    As an aside on the original post, I had an instructor at University who did not let us use the word "bug". We had to use the words "error" or "failure" instead. His reasoning was that using the word "bug" leads to the subconscious belief that the fault isn't really your fault, you just happened to leave a window open and a bug flew in and tried to mate with a light bulb. Using the word "failure" means that you are conscious that you made a mistake and that you need to fix it.

    To put it another way: if there is a fault in the code it is because some programmer somewhere failed to do their job properly. They should take ownership of their failure and deal with it.

    I'm not sure I believed it at the time but now I know more about neuro-linguistic programming than I knew then, I see his point.

    As the OP said, of course, if I didn't write the code in question then it certainly isn't fair to blame the failure on me.



  • @FragFrog said:

    I also warn him that this change fundamentally alters the way data acquisition is performed, and should therefore be tested extensively before deploying to our clients.

    Really??? You have a mission critical CMS, where you make a change that fundamentally alters something important, and YOU don't test? YOU don't run the automated tests that prove that everything is OK? YOU don't go look to see what the issue is and prove that it's not your fix that broke it?

    Here is the WTF: software engineers that write code and don't test it. And managers who promote code to production without asking for proof that it's been regression-tested.


  • Considered Harmful

    @havokk said:

    Using the word "failure" means that you are conscious that you made a mistake and that you need to fix it.

    My place of employment prefers the term "defect", which I initially found sort of accusatory. It took a little while before I stopped taking "defects" personally, especially when they were unspecified enhancement requests or deliberate implementation decisions. It was only after our first couple of projects when I saw how much improved the product was after resolving a couple dozen defects - many of which were of the "oh this would stand out more in blue" variety - that I got over that. The most frustrating ones were the "I don't like the animation that you spent 4 hours meticulously scripting" or "I changed my mind about the AJAX loader that you had to redesign the whole workflow to accommodate" defects, but you suck it up and move on.



  • @DrPepper said:

    Really??? You have a mission critical CMS, where you make a change that fundamentally alters something important, and YOU don't test? YOU don't run the automated tests that prove that everything is OK? YOU don't go look to see what the issue is and prove that it's not your fix that broke it?

    Why on earth would you get that idea? Of course I ran all the automated tests. Of course it worked just fine in all my tests as well. But we have a dedicated team for testing, and not everything shows up in the automated tests. If you had read my comment carefully instead of glancing over it to make a snarky remark, you would also know that it had been in use for hours before people even noticed something was not working exactly as it should - this was not a case of "fire and forget", but rather "okay, I stop this little cog in the huge machine from spinning crazy, and all the cogs around it seem to work exactly as they should, so in theory it is save, but since the machine is frikkin' ENORMOUS I can't guarantee that entirely".

    As I said, this was a [i]huge[/i] system - the part I worked on was an intricate DBAL several tens of thousands of lines of code, written by people who had long ago left for greener pastures, and which had not really been touched for years. Essentially, nobody knew just exactly how all those little cogs worked together; as a result, I spend about ten hours just following the flow, before making a change that was maybe no more than a dozen lines of code. The change was small, simple, and it should not have broken anything; and for all I know, it didn't.

    As for the intern: he's a really nice guy, and by that time I had already rewritten the change, so no hard feelings. If I wanted my code to last, I wouldn't be in the webdevelopment business.



  • @havokk said:

    I had an instructor at University who did not let us use the word "bug". We had to use the words "error" or "failure" instead. His reasoning was that using the word "bug" leads to the subconscious belief that the fault isn't really your fault, you just happened to leave a window open and a bug flew in and tried to mate with a light bulb.
     

    Interesting viewpoint, and I agree with it too - considering the origins of the word "bug" (in the context of computer errors).@havokk said:

    Using the word "failure" means that you are conscious that you made a mistake and that you need to fix it.

    Not certain I agree with that because..

    @joe.edwards said:

    My place of employment prefers the term "defect", which I initially found sort of accusatory.

    The ISTQB are specific about terminology:

    • error - a mistake made by a programmer
    • defect - the effects of that mistake (flaw in the code, a "bug")
    • failure - observable effects of that defect.

    Your place using the term "defect" is not wrong, but "failure" describes the incident - what did the end-user experience? A developer will then perform root cause analysis to locate the "defect" (the problem behind the failure).

    All software contains defects - some may not lead to failures because of the specific rare conditions that require them to trigger.

     

     

     



  • @havokk said:

    I had an instructor at University who did not let us use the word "bug". We had to use the words "error" or "failure" instead.
     

    Your instructor was Edsger Dijkstra?



  • @DrPepper said:

    Really??? You have a mission critical CMS, where...
     

     My response got swallowed, but FragFrog beat me to it.

    @DrPepper said:

    Here is the WTF: software engineers that write code and don't test it.

    No, the WTF is that untested code finds its way into production. Software engineers may be coders or testers but not both[1]. I agree that code needs to be tested but disagree that software engineers are entirely responsible for this activity. That's why independent testers and QA teams exist.

    @DrPepper said:

    And anyone who promotes code to production without asking for proof that it's been regression-tested it being Quality Assured.

    FTFY. Proof that it's been tested isn't enough: production requires the code to satisfy a predefined quality.

    [1] excepting unit testing. 



  • @Cassidy said:

    No, the WTF is that untested code finds its way into production. Software engineers may be coders or testers but not both

     

    Within the scope of a given project, agreed. But I can't see why two different sets of engineers couldn't test each other's projects. (By analogy, as an accountant, I sometimes participate in generating financial information and sometimes in auditing it—but never both for the same client.)

     



  • @silverpie said:

    But I can't see why two different sets of engineers couldn't test each other's projects.
     

    They could. However, engineers can test up to a specific level: I'd expect them to perform unit tests or integration tests, but not really be in a position to do UAT.[1]

    Upshot of the story is that untested code found its way into production. I just took issue with DrPepper blaming FragFrog for lack of testing as being the cause of the failure. 

    [1] depends, again. An engineer could well be an end-user of said system, but I'm descending into self-pedantry now.


Log in to reply