• Rodnas (unregistered)

    Fist. Of course. And why should i pay money to write bad code? I do that for free, so my boss can get some money of our clients to fix these ommisions.

  • (cs)

    Alright, so for logo you chose the powerset of the empty set. Gee. Meaningful.

  • highphilosopher (unregistered)

    I'm not going to start with the whole cap and trade discussion, but seriously if you got people to send you money already because they wrote bad code, then I'd like to offer everyone a better deal. Send me your money and I'll fix your bad code. Yes, rather than leave the bad code laying around for our children and our children's children to deal with, I'll fix it! Just send your paypal money, and the bad piece of code to __@__________.com. We'll set a rate of say $.99 per line, and together we'll rid the world of bad code!

  • (cs)

    TRWTF of course is that you are obviously getting tons of admissions of guilt and not posting their names here as "hey, look at all these dumbasses that write bad code!!!"

  • SR (unregistered) in reply to amischiefr
    amischiefr:
    TRWTF of course is that you are obviously getting tons of admissions of guilt and not posting their names here as "hey, look at all these dumbasses that write bad code!!!"

    A programmer that never writes bad code is either lying or never delivers anything. Go on. Admit it. It's good for the soul.

    I'll start you off if you like. I'm SR and I've written bad code. I even sometimes write bad code now.

  • (cs) in reply to SR
    SR:
    A programmer that never writes bad code is either lying or never delivers anything. Go on. Admit it. It's good for the soul.

    I'll start you off if you like. I'm SR and I've written bad code. I even sometimes write bad code now.

    I'm JC2 and it's been 3 weeks since I last wrote bad code.

    (I've been on holiday)

  • yetihehe (unregistered) in reply to JuanCarlosII
    JuanCarlosII:
    SR:
    A programmer that never writes bad code is either lying or never delivers anything. Go on. Admit it. It's good for the soul.

    I'll start you off if you like. I'm SR and I've written bad code. I even sometimes write bad code now.

    I'm JC2 and it's been 3 weeks since I last wrote bad code.

    (I've been on holiday)

    I've wrote some bad code just minutes ago. Now that project is finished, I can resume wworking on another, where I'm writing a slightly less bad code, but as deadline is tomorrow afternoon, I expect some rally bad snippets to creep in.

  • Derek (unregistered)

    Thats the biggest WTF I've seen in a long time!

  • Brompot (unregistered)
    TDWTF:
    and doing what we do: spending hard-earned money and precious time to build a better tomorrow, one line of code at a time.

    That's what I do all day. It's what I live from.

    Captcha: erat. The singular of erata?

  • frits (unregistered)

    I don't write bad code, I demand others write it for me. Plz, send codez now! It's urgent!

  • Inhibeo (unregistered) in reply to frits

    I'm not asking you if people will be able to see the logo, I'm telling you I want black on black!

  • math nerd (unregistered) in reply to ounos

    Actually, according to Cantor, the cardinality of that set is the definition of 1 -- or an ACE.

  • AC (unregistered)

    OK, fourth try at posting this. %*($%$£"& spam filter....

    The PostgreSQL cheque is addressed to the US user group. If it is going to offset bad code, then it should go to the developer's SPI fund, the URL to which is triggering the spam filter, but is easy to find on www.postgresql.org...

  • (cs)

    While admirable, isn't encouraging people to write good code bad for the WTF business?

  • Alois Cochard (unregistered)

    This Bad Code Offsets is a wonderful initiative, I was thinking giving some money to OS project at this end of year.

    I gonna buy Bad Code Offset instead, love all projects you have selected :-D

  • TheCPUWizard (unregistered)

    My comment got too long...so I made a blog post out of it.

    Check out: http://geekswithblogs.net/TheCPUWizard/archive/2009/12/03/thinkyouwritegoodcode.aspx

  • (cs) in reply to halcyon1234
    halcyon1234:
    While admirable, isn't encouraging people to write good code bad for the WTF business?
    Is encouraging people to eat healthier bad for the undertaker business?
  • Anon (unregistered)
    Now if you do the math, you'll notice that the sum of the checks is $250.00 less than the cash received. There's a good reason for that.
    Going to make us ask? OK, what is the good reason for that?

    -- Note from Alex: that would be to pay for the first half of the $500 Grant...

  • (cs) in reply to SR
    SR:
    amischiefr:
    TRWTF of course is that you are obviously getting tons of admissions of guilt and not posting their names here as "hey, look at all these dumbasses that write bad code!!!"

    A programmer that never writes bad code is either lying or never delivers anything. Go on. Admit it. It's good for the soul.

    I'll start you off if you like. I'm SR and I've written bad code. I even sometimes write bad code now.

    Never.

    Nope.

    I write elegant code such as: if(true == isTrue) doSomethingImportant(isTrue);

    Notice how I place the true on the left hand side so that I don't accidentally assign it to isTrue? Pure brilliance if you ask me, which I'm sure you would have. I mean, you would have wouldn't you?

  • Christopher (unregistered) in reply to Anon
    Anon:
    Now if you do the math, you'll notice that the sum of the checks is $250.00 less than the cash received. There's a good reason for that.
    Going to make us ask? OK, what is the good reason for that?

    That's probably what it costs to print out giant versions of the checks.

  • Marvin the Martian (unregistered)

    Wow. This is just like Second Life: a small scale imitation of the drudgery of real life.

    After spending 10-25% of our time applying for grants --- argueing how each bit will be spent and make a real difference for poor urban kids, or will organise (1% of) a breakthrough conference --- scientists then get these small grants that are exactly what has been put into the grant-writing, if you count a reasonable salary per hour (writers, reviewers, and all grant body administration). Well, if you get it (on average you don't, some have 10% success rates).

    So call me jaded if it seems a lot of effort. On the other hand, winning this award will bring some recognition allowing a cascade of other, larger, grants to come into sight (not grasp) I presume. Just like in real life.

    Captcha: odio. How amusingly applicable: both as Latin "I HATE" and Italian "Oh God" (+-).

    /end-rant-and-back-to-chickenfeed-grant-submission-writing

  • SR (unregistered) in reply to amischiefr
    amischiefr:
    Never.

    Nope.

    I write elegant code such as: if(true == isTrue) doSomethingImportant(isTrue);

    Notice how I place the true on the left hand side so that I don't accidentally assign it to isTrue? Pure brilliance if you ask me, which I'm sure you would have. I mean, you would have wouldn't you?

    You've not handled FILE_NOT_FOUND. Offset! Offset! Offset!

  • (cs)

    If it's intending to become a real nonprofit organization, shouldn't it have a site in a .org domain instead of .com?

  • somedude (unregistered)

    I wrote a query, then while looping over the resultset, invoked yet another query.

  • Bim Job (unregistered) in reply to Alois Cochard

    Note from Alex: this comment is obviously a troll, because no one is really this stupid. Kept around for the fun factor.

    Alois Cochard:
    This Bad Code Offsets is a wonderful initiative, I was thinking giving some money to OS project at this end of year.

    I gonna buy Bad Code Offset instead, love all projects you have selected :-D

    I was mildly disoriented by the first "Bad Code Offset" post, but then I read through the responses from our friends in the community, and was fairly certain that it was a (possibly very good) joke.

    This ... this is no longer a joke. This is a joke. (There is a difference.)

    Throwing money at these people out of a simple sense of personal failure, wanting to join a "wonderful initiative," or just (in my case) spite is a hideous misdirection of the charity gene.

    You could have picked any other five. But, given the five you've chosen:

    • Apache. Are you insane? The damn thing should have stopped in 2002. It was just about workable then, and has degenerated into weird and unstable SOAP/WSDL "frameworks" since.
    • jQuery. They seem to be doing all right by themselves. I'm not a Java programmer. I wouldn't know. As choices go, not bad.
    • PostgreSQL. They also seem to be doing all right by themselves. I guess if you have a boner against Oracle, you might want to throw money at an organisation that really doesn't need it.
    • Drupal. Now you really are insane.
    • FreeBSD ... well, I'm definitely in favour of this one. I just wouldn't do it by jumping the shark with "Bad Code Offsets."

    Yeah ... I know it's just $3000. Hell, you can barely get a decent Subaru for that; let alone working software.

    But what the fuck are you thinking?

  • Merchant Banker (unregistered)

    http://www.ibras.dk/montypython/episode30.htm

    Mr Alex You get one of these, sir. (he gives him a Bad Code Offset certificate)

    City Gent It's a bit small for a share certificate isn't it? Look, I think I'd better run this over to our legal department. If you could possibly pop back on Friday...

    Mr Alex Well do you have to do that, couldn't you just give me the pound?

    City Gent Yes, but you see I don't know what it's for.

    Mr Alex It's for the developers.

    City Gent Yes?

    Mr Alex It's a gift.

    City Gent A what?

    Mr Alex A gift.

    City Gent Oh a gift!

    Mr Alex Yes.

    City Gent A tax dodge.

    Mr Alex No, no, no, no.

    City Gent No? Well, I'm awfully sorry I don't understand. Can you just explain exactly what you want.

    Mr Alex Well, I want you to give me a pound, and then I go away and give it to the developers.

    City Gent Yes?

    Mr Alex Well, that's it.

    City Gent No, no, no, I don't follow this at all, I mean, I don't want to seem stupid but it looks to me as though I'm a pound down on the whole deal.

    Mr Alex Well, yes you are.

    City Gent I am! Well, what is my incentive to give you the pound?

    Mr Alex Well the incentive is - to make the developers happy.

    City Gent (genuinely puzzled) Happy?... You quite sure you've got this right?

    Mr Alex Yes, lots of people give me money.

    City Gent What, just like that?

    Mr Alex Yes.

    City Gent Must be sick. I don't suppose you could give me a list of their names and addresses could you?

    Mr Alex No, I just go up to them in the street and ask.

    City Gent Good lord! That's the most exciting new idea I've heard in years! It's so simple it's brilliant! Well, if that idea of yours isn't worth a pound I'd like to know what is. (he takes the tin from Alex)

    Mr Alex Oh, thank you, sir.

    City Gent The only trouble is, you gave me the idea before I'd given you the pound. And that's not good business.

    Mr Alex Isn't it?

    City Gent No, I'm afraid it isn't. So, um, off you go. (he pulls a lever opening a trap door under Alex's feet and Alex falls through with a yelp) Nice to do business with you.

  • Blue Collar (unregistered)

    I think the idea behind this initiative is great. Open source free projects that allow developers to utilize the good code done by professionals is definitely a good practice that should be promoted as much as possible.

    That being said, your always going to have bad coders out there... people who think they know everything that simply ignore all the good things available out there and try and re-invent the wheel every time. One thing that the development community lacks is a certification process. I am not talking about Microsoft certification, or Sun certification or any language specific, but perhaps a certification for general development knowledge. One that forces developers to draw on common sense in order to pass. Perhaps this is something the "Alliance" would consider in the future, when they have the reputation and clout to start. Of course it will also require that companies buy into this as well. I am well aware of such barriers to this, and I know I will get blasted and told I am idiot for suggesting it, but there has to be someway to widdle down the hacks in our industry...

  • Blue Collar (unregistered) in reply to Bim Job
    Bim Job:
    Alois Cochard:
    This Bad Code Offsets is a wonderful initiative, I was thinking giving some money to OS project at this end of year.

    I gonna buy Bad Code Offset instead, love all projects you have selected :-D

    I was mildly disoriented by the first "Bad Code Offset" post, but then I read through the responses from our friends in the community, and was fairly certain that it was a (possibly very good) joke.

    This ... this is no longer a joke. This is a joke. (There is a difference.)

    Throwing money at these people out of a simple sense of personal failure, wanting to join a "wonderful initiative," or just (in my case) spite is a hideous misdirection of the charity gene.

    You could have picked any other five. But, given the five you've chosen:

    • Apache. Are you insane? The damn thing should have stopped in 2002. It was just about workable then, and has degenerated into weird and unstable SOAP/WSDL "frameworks" since.
    • jQuery. They seem to be doing all right by themselves. I'm not a Java programmer. I wouldn't know. As choices go, not bad.
    • PostgreSQL. They also seem to be doing all right by themselves. I guess if you have a boner against Oracle, you might want to throw money at an organisation that really doesn't need it.
    • Drupal. Now you really are insane.
    • FreeBSD ... well, I'm definitely in favour of this one. I just wouldn't do it by jumping the shark with "Bad Code Offsets."

    Yeah ... I know it's just $3000. Hell, you can barely get a decent Subaru for that; let alone working software.

    But what the fuck are you thinking?

    You just lost all your credibilty when you said "jQuery, I'm not a java programmer..."

    LOL!

  • Bim Job (unregistered) in reply to Blue Collar
    Blue Collar:
    Bim Job:
    Alois Cochard:
    This Bad Code Offsets is a wonderful initiative, I was thinking giving some money to OS project at this end of year.

    I gonna buy Bad Code Offset instead, love all projects you have selected :-D

    I was mildly disoriented by the first "Bad Code Offset" post, but then I read through the responses from our friends in the community, and was fairly certain that it was a (possibly very good) joke.

    This ... this is no longer a joke. This is a joke. (There is a difference.)

    Throwing money at these people out of a simple sense of personal failure, wanting to join a "wonderful initiative," or just (in my case) spite is a hideous misdirection of the charity gene.

    You could have picked any other five. But, given the five you've chosen:

    • Apache. Are you insane? The damn thing should have stopped in 2002. It was just about workable then, and has degenerated into weird and unstable SOAP/WSDL "frameworks" since.
    • jQuery. They seem to be doing all right by themselves. I'm not a Java programmer. I wouldn't know. As choices go, not bad.
    • PostgreSQL. They also seem to be doing all right by themselves. I guess if you have a boner against Oracle, you might want to throw money at an organisation that really doesn't need it.
    • Drupal. Now you really are insane.
    • FreeBSD ... well, I'm definitely in favour of this one. I just wouldn't do it by jumping the shark with "Bad Code Offsets."

    Yeah ... I know it's just $3000. Hell, you can barely get a decent Subaru for that; let alone working software.

    But what the fuck are you thinking?

    You just lost all your credibilty when you said "jQuery, I'm not a java programmer..."

    LOL!

    Well, I try not to be a javascript programmer either.

    It just sorta creeps up on you.

  • Helix (unregistered)

    Money for Social Narcotics, the most dangerous narcotics around.

  • Shamit Kumar Tomar (unregistered) in reply to Bim Job
    Bim Job:
    Alois Cochard:
    This Bad Code Offsets is a wonderful initiative, I was thinking giving some money to OS project at this end of year.

    I gonna buy Bad Code Offset instead, love all projects you have selected :-D

    I was mildly disoriented by the first "Bad Code Offset" post, but then I read through the responses from our friends in the community, and was fairly certain that it was a (possibly very good) joke.

    This ... this is no longer a joke. This is a joke. (There is a difference.)

    Throwing money at these people out of a simple sense of personal failure, wanting to join a "wonderful initiative," or just (in my case) spite is a hideous misdirection of the charity gene.

    You could have picked any other five. But, given the five you've chosen:

    • Apache. Are you insane? The damn thing should have stopped in 2002. It was just about workable then, and has degenerated into weird and unstable SOAP/WSDL "frameworks" since.
    • jQuery. They seem to be doing all right by themselves. I'm not a Java programmer. I wouldn't know. As choices go, not bad.
    • PostgreSQL. They also seem to be doing all right by themselves. I guess if you have a boner against Oracle, you might want to throw money at an organisation that really doesn't need it.
    • Drupal. Now you really are insane.
    • FreeBSD ... well, I'm definitely in favour of this one. I just wouldn't do it by jumping the shark with "Bad Code Offsets."

    Yeah ... I know it's just $3000. Hell, you can barely get a decent Subaru for that; let alone working software.

    But what the fuck are you thinking?

    So, you think jQuery is written in Java? And you love FreeBSD doesn't mean that all other projects are a waste. Creating free and usable content takes time. And Time = Money. So, it costs money. I am with jQuery and will always be. Though, I am thinking of donating jQuery directly and becoming a patron by paying $50 to the Alex's Alliance. :) You sir, should better edit EncyclopediaDramatica in free time rather than trolling here.

    Alex, go on, we are with you.

  • (cs) in reply to Blue Collar
    Blue Collar:
    Bim Job:
    I was mildly disoriented by the first "Bad Code Offset" post, but then I read through the responses from our friends in the community, and was fairly certain that it was a (possibly very good) joke.

    This ... this is no longer a joke. This is a joke. (There is a difference.)

    Throwing money at these people out of a simple sense of personal failure, wanting to join a "wonderful initiative," or just (in my case) spite is a hideous misdirection of the charity gene.

    You could have picked any other five. But, given the five you've chosen:

    • Apache. Are you insane? The damn thing should have stopped in 2002. It was just about workable then, and has degenerated into weird and unstable SOAP/WSDL "frameworks" since.
    • jQuery. They seem to be doing all right by themselves. I'm not a Java programmer. I wouldn't know. As choices go, not bad.
    • PostgreSQL. They also seem to be doing all right by themselves. I guess if you have a boner against Oracle, you might want to throw money at an organisation that really doesn't need it.
    • Drupal. Now you really are insane.
    • FreeBSD ... well, I'm definitely in favour of this one. I just wouldn't do it by jumping the shark with "Bad Code Offsets."

    Yeah ... I know it's just $3000. Hell, you can barely get a decent Subaru for that; let alone working software.

    But what the fuck are you thinking?

    You just lost all your credibilty when you said "jQuery, I'm not a java programmer..."

    Yeah, that was pretty funny, but mostly this just seems like the rant of someone who learned one way to do it (e.g. the Microsoft Stack) and assumes that, since running fully-licensed non-arbitrarily-gimped versions of everything it will take to get your web app running is actually a rather expensive endeavor, these scoff FREE products probably aren't worth the $0.30 of the HDD they rest on.

    Now, without addressing your comments about the server with the highest market share of any HTTP server (for at least the last 10 years, by a tremendous margin; source) too much more than I did just a few words ago, what is your problem with Drupal? Is it that it's written in PHP, and you've been reading too much Jeff Atwood and are convinced that PHP is a language which, once used, turns anyone into a babbling buffoon unable to produce anything worth pixels it takes to display it?

    These free tools give everyone, not just the people willing to dump thousands into licenses (or anything into licenses, really), the chance to do, and do better. And, since by-and-large these guys aren't trying to make you pay for upgrades, they have more incentive to write it well the first time around, rather than get something out the door and then patch it up later, or release a new AppMajor and offer you a special price of only 88% of the retail price!

  • justsomedude (unregistered)

    That's a Helluva signature you have there :-)

  • Bim Job (unregistered) in reply to DrJDX
    DrJDX:
    Blue Collar:
    You just lost all your credibilty when you said "jQuery, I'm not a java programmer..."
    Yeah, that was pretty funny, but mostly this just seems like the rant of someone who learned one way to do it (e.g. the Microsoft Stack) and assumes that, since running fully-licensed non-arbitrarily-gimped versions of everything it will take to get your web app running is actually a rather expensive endeavor, these *scoff* FREE products probably aren't worth the $0.30 of the HDD they rest on.
    Seems like that to whom?

    The $0.30 doesn't even cover the postage. YourAdministrationCostsMayVary.

    But that wasn't the issue I tried to address. I've run Apache servers. I've even packaged the fucking things up for telcoms, including .conf fixes for various (and, quite honestly, rare) security holes. I have no problem with using an Apache server. I've got something of a problem with bunging money at the Apache foundation to develop the crap they've come out with since circa 2002.

    And yes, I've tried them (particularly the WSDL ones). They're a limping disaster.

    "Free" is not the issue here. Except if you're like Alex, and suckering other people into throwing money at tossers who are "free."

    DrJDX:
    And, since by-and-large these guys aren't trying to make you pay for upgrades, they have more incentive to write it well the first time around, rather than get something out the door and then patch it up later, or release a new AppMajor and offer you a special price of only 88% of the retail price!
    Citation needed. None of this "by-and-large" bollocks.

    When did you last install free software where this unsubstantiated "incentive to write it well the first time around" actually delivered?

    Explain, please. What exactly is this "incentive," if it isn't money?

    Not that the Apache organisation is short of that. They're short of good programmers, good managers, good testers and good technical writers (no particular order, although their technical writers are absolute shit).

    But they're not short of money.

    Cute *scoff, btw.

  • Bill P. Godfrey (unregistered)

    Could you do a 3XL/TALL or a 4XL shirt please?

    I'm not overweight. I'm underheight.

  • commenter (unregistered) in reply to yetihehe

    I'm fp and I have written bad code, although its tough so I have been attempting to stay on the bad-ass code wagon.

    The badest (non-bad-ass) code I must confess had a global 'int i' variable which 'to use less memory' on iterators.

    These bad-code offsets could be a lifesaver.

  • (cs) in reply to Anon
    Anon:
    Now if you do the math, you'll notice that the sum of the checks is $250.00 less than the cash received. There's a good reason for that.
    Going to make us ask? OK, what is the good reason for that?
    Alex needs a Wii?
  • Bim Job (unregistered) in reply to cconroy
    cconroy:
    Anon:
    Now if you do the math, you'll notice that the sum of the checks is $250.00 less than the cash received. There's a good reason for that.
    Going to make us ask? OK, what is the good reason for that?
    Alex needs a Wii?
    I'll personally buy him one if he knocks this cretinous idea on the head.
  • Mindaugas (unregistered)

    Before I'll consider buying a T-Shirt, can I see a photo with it on a person?

  • J. Random PMP (unregistered)

    I used to write bad code, then I saw the light and became a Project Manager!

    Now I have other people write the bad code for me!

  • Mischief (unregistered)

    You can end bad code with one word.... "No". When your boss puts you in a situation that creates bad code, simply refuse to do it and tell him/her to get more time/budget if they want something done.

    The only way to end bad code is to stop making it. There is nothing a cute project can do about it.

  • Bim Job (unregistered) in reply to Mindaugas
    Mindaugas:
    Before I'll consider buying a T-Shirt, can I see a photo with it on a person?
    Nicest troll for a while.[image]
  • Bim Job (unregistered) in reply to Mindaugas
    Bim Job:
    Mindaugas:
    Before I'll consider buying a T-Shirt, can I see a photo with it on a person?
    Apologies. I'll try that again. Nicest troll for a while. [image]
  • Worse Than Lurker (unregistered) in reply to Bim Job
    Bim Job:
    cconroy:
    Anon:
    Now if you do the math, you'll notice that the sum of the checks is $250.00 less than the cash received. There's a good reason for that.
    Going to make us ask? OK, what is the good reason for that?
    Alex needs a Wii?
    I'll personally buy him one if he knocks this cretinous idea on the head.
    I have a feeling that trying to knock this idea on the head would end Worse Than Failure, if you know what I mean.
  • (cs)

    Alex when you announced this at first I seriously thought it was a joke but I see now that you were quite serious. Apologies. :-)

  • Miss Molly (unregistered) in reply to Blue Collar
    Blue Collar:
    I think the idea behind this initiative is great. Open source free projects that allow developers to utilize the good code done by professionals is definitely a good practice that should be promoted as much as possible.

    That being said, your always going to have bad coders out there... people who think they know everything that simply ignore all the good things available out there and try and re-invent the wheel every time. One thing that the development community lacks is a certification process. I am not talking about Microsoft certification, or Sun certification or any language specific, but perhaps a certification for general development knowledge. One that forces developers to draw on common sense in order to pass. Perhaps this is something the "Alliance" would consider in the future, when they have the reputation and clout to start. Of course it will also require that companies buy into this as well. I am well aware of such barriers to this, and I know I will get blasted and told I am idiot for suggesting it, but there has to be someway to widdle down the hacks in our industry...

    The problem is we are all (most, at least) bad coders some of the time. I'm sure almost anyone who has written any amount of code will have had a moment during debugging (or worse still root cause analysis after a major incident) when we come across a piece of code and think..."WTF was I thinking!!!"

    I think because of the nature of development, many developers have moments where they're flat out, and moments when they have no motivation/idea. The problem with being flat out, is that in a hurry to get all your ideas tried out, you don't necessarily think through them properly. This often means that awful (though working) code creeps in.... A (slightly extreme) example that we have seen here is the:

    if (condition == true) 
    {
        otherCondition=true;
    }
    else
    {
        otherCondition = false;
    }
    

    Once things have calmed down, this is (very) obviously a little silly, it's an easy mistake to make when you are thinking big picture not technical detail (because the way most people actually think about it as they're coding is "if that's true then we need to set this to true", rather than "we need to set this condition to be the same as that condition" {possibly depends on the context}). Many experienced programmers can eventually train themselves to recognise these sort of things even when they're flat out, but there's always a situation where something could be done: a) clearer b) better (not sure what I mean here) c) more efficiently Usually, you need to sacrifice at least one of these for another - and though it seems ludicrous, the example above is probably clearer for most (especially non-Technical) people to understand because it closely resembles the thought process involved in the action....

    This particular example is only silly because we explicitly use true and false in the test...Consider something like this:

    if(coffeeCup.isEmpty())
    {
        needMoreCoffee=true;
    }
    else
    {
        needMoreCoffee=false;
    }
    

    To the average monkey, this is probably more clear than

    needMoreCoffee=coffeeCup.isEmpty();
    

    Even though they both have much the same result (and many people would no doubt argue that the lower one is more efficient)

    Summing up, I think I've ranted all over the place, but the point (basically) was:

    1. Bad code is subject to definition - Code that is bad from one perspective may make sense from an other. Clear Code may be efficient, and efficient code may appear very obfuscated)
    2. We all (AFAIK) write code that we later look at and consider bad/wrong/inefficient/unclear etc.
    3. (Not sure whether I said this) the WORST hackers are those who do not recognise the possibility that something they did might have been silly - not the ones who make a stupid mistake in their code
    4. Different Strokes for different folks, Horses for courses etc etc etc

    etc etc and Blah...

  • Mister Molly (unregistered) in reply to Miss Molly
    Miss Molly:

    <tinSnips.Cut()>

    if(coffeeCup.isEmpty())
    {
        needMoreCoffee=true;
    }
    else
    {
        needMoreCoffee=false;
    }
    

    To the average monkey, this is probably more clear than

    needMoreCoffee=coffeeCup.isEmpty();
    

    Even though they both have much the same result (and many people would no doubt argue that the lower one is more efficient)

    (Maybe this is what you were trying to say - not very clear) but the reason the first example is clearer, is, oddly enough, that the human mind can't see a definite link between the empty cup and needing coffee. In the first example, despite the end result being identical, someone reading over the code can see the thought process - Check whether the coffee cup is empty, and refill it. The second example appears to make a stronger link as sort of 'when the cup is empty i need to refill it'

    Despite both of these snippets setting the needCoffee flag under the same conditions, the first appears not to have been linked as strongly to the empty cup, because it works us through the thought process...

    That's probably not clear, and definitely Off Topic, so I go now...

  • (cs)

    I'm going to start writing all my code in a single line so I can just buy a single SLOC BCO per project... :-D

    namespace MyProject { public class MyClass { public MyClass() { }... } }

    You get the picture... it's gonna save me a lot of money, while allowing me to exponentially compound the problem of the bad code that I'm writing.

  • Nick (unregistered)

    I'd consider becoming a patron member if I could be sure the money I spent wouldn't be repurposed after the fact for some new award. Not a big deal considering I only contributed $5, but I'm usually kinda picky about that sort of thing when I donate money to charities. I like them to use the money how they said they were going to use it.

  • Charles400 (unregistered)

    Offsets are too much of a burden. I'll just do like the manufacturing sector by sending the development work offshore then laying off my programmers.

Leave a comment on “Bad Code Offsets: An Update”

Log In or post as a guest

Replying to comment #292352:

« Return to Article