• (cs) in reply to gallier2
    gallier2:
    WC:
    eVil:
    A sinlge if could probably do the job, but surely you'd have to write some pretty inglorious code to achieve that.

    As it stands, the code is readable and efficient, so I dont see what you'd gain by refactoring it?

    Thanks. I was starting to doubt my sanity on that one because I could not imagine the ugly if statement required to validate that in the same way.

    As always the RWTF are the comments.

    integer ival = cint(val) bolMatch = (ival >= 3000 and ival <= 3299) or (ival >= 3351 and ival <= 3441) or (ival >= 5964 and ival <= 5969)

    In the worst case the original does: 394 loop (compare+increment) + 394 comparisons + 2394 int conversions. In the best case it does: 96 loop (compare+increment) + 96 comparisons + 296 int conversions. (if it finds the value in the first loop, the other loops are executed).

    My implementation has in the best case 2 comparisons + 1 conversion in the best case (if that unrecognized language has short cut evaluation) and at most 6 comparisons and 1 conversion.

    This isn't Stack Overflow. Nobody is actually trying to correct or improve the code. Except you.
  • Some damn Yank (unregistered) in reply to Tracy
    Tracy:
    For the QUARTERS_IN_A_YEAR, I worked at a company that decided to switch from starting the fiscal year in October to starting it in January. That meant some contortions, making one year have 3 quarters and the next one 5. It was a one time thing but the financial software had to deal with it.
    Why did the first year have 3 quarters? Wasn't it Oct-Sept as before, and the next year was 5 quarters, Oct to the following Dec, followed by 4 quarters Jan-Dec?

    CAPTCHA: venio. I need to drink some venio after that!

  • gallier2 (unregistered) in reply to frits
    frits:
    This isn't Stack Overflow. Nobody is actually trying to correct or improve the code. Except you.

    Eat shit. You're not in charge of defining what is appropriate or not to post on this blog.

  • me (unregistered)

    Produce is chicken wing. With wing bark. No Qautk.

  • (cs) in reply to gallier2
    gallier2:
    frits:
    This isn't Stack Overflow. Nobody is actually trying to correct or improve the code. Except you.

    Eat shit. You're not in charge of defining what is appropriate or not to post on this blog.

    That's not very polite. Do you think we don't know how to check if a number is in a range? We do. Probably every one of us. Even the dumb ones.
  • Little Green Men (unregistered) in reply to gallier2

    gallier2:
    frits:
    This isn't Stack Overflow. Nobody is actually trying to correct or improve the code. Except you.

    Eat shit. You're not in charge of defining what is appropriate or not to post on this blog.

    Careful. There was a Nagesh on here a while back, and I think he died from doing something very similar.
  • Ken Jennings (unregistered) in reply to gallier2

    I'll take "Non-Subtle Attempts to Start a Flamewar" for 100, Alex.

  • Helena Handcart (unregistered) in reply to gallier2
    gallier2:
    frits:
    This isn't Stack Overflow. Nobody is actually trying to correct or improve the code. Except you.

    Eat shit. You're not in charge of defining what is appropriate or not to post on this blog.

    It looks like gallier2 wrote the original code, and feels guilty for it. To make amends he's posted a super-efficient rewrite in the hope of saving his soul. He's bound to get shirty if you go and pooh-pooh his considerable efforts. I for one will be implementing his visionary rewrite just as soon as I can.

    Now, where's the upvote button?

  • (cs) in reply to Danimal
    Danimal:
    "A lot of students only go to school three quarters a year," Bob writes, "so maybe the author thought a business might take a summer off. Or try to squeeze another one in."

    const QUARTERS_IN_A_YEAR = 4;

    ... several codefiles later...

    private String[] getQuarters() { String[] quarters = new String[QUARTERS_IN_A_YEAR]; for (int k = 0; k < quarters.length; k++) { quarters[k] = new Integer(k+1).toString(); } return quarters; }

    The REAL WTF is that there are always 4 quarters in a year. There could be 3 trimesters, though.

    I'm voting this one the least WTF-y of the bunch. QUARTERS_IN_A_YEAR explains exactly why this number is here. Words are more explanatory than numbers in almost all cases.

    A word is worth 1,000 numbers.

  • RRDY (unregistered) in reply to ac
    ac:
    eVil:
    Plus its fine to break out of a for loop, so long as its obvious why you're breaking, and the loop isn't horrendously complicated.

    People just think that its bad practice, because it similar to using 'goto's in a way... however it is a very specific form of goto.... eg one that doesn't cause a spaghetti-code problem.

    Just like "goto", the "break" keyword does not cause spaghetti-code problems. The problem is that people use it in spaghetti logic which causes spaghetti-code problems.

    Consider Windows SDK C++ examples for SSL negotiation, which involves repeatedly invoking the same function (InitializeSecurityContext() on the client and AcceptSecurityContext() on the server) at different steps of the negotiation process. The thing is, each set requires a different combinations of parameters and have different effects, different error codes, etc.

    For some reason, the developer who wrote the example noticed the process involves almost exclusively calls to the same function and thought it was a good idea to make one big loop out of this. The mess is full of "break" and "continue" statements. All structured programming. All-star spaghetti.

    Sounds like a state machine is in order here, which could indeed be implemented as a loop, minus the spaghetti.

    CAPTCHA: nobis (we're all in this together I guess)

  • Vladimir Poutines (unregistered) in reply to gallier2
    I we tall did:
    Eat shit. You're not in charge of defining what is appropriate or not to post on this blog.
    As far as I can tell, that seems to be every user's job around here.
  • (cs) in reply to D-Coder
    D-Coder:
    ... Words are more explanatory than numbers in almost all cases.

    A word is worth one-thousand numbers.

    FTFY

  • gallier2 (unregistered) in reply to frits
    frits:
    That's not very polite. Do you think we don't know how to check if a number is in a range? We do. Probably every one of us. Even the dumb ones.

    You think you were polite? And did you follow the quotes in my post? There seem to be people who think that the original code was not that bad. May be they were joking, but having followed comments here for several years now, there's no doubt that there are people dense enough, to not get why the original code was a WTF. Furthermore, some people prefer comments with content. 'frist', "wooden table" and "bobby tables" comments have been boring since their first time they were posted.

  • blah (unregistered)

    preg_replace huh. Another Alex FAIL.

  • (cs) in reply to ac
    ac:
    SCSimmons:
    Am I missing something? This seems to me to return a four-element array of strings, getQuarters(0) is "1", (1) is "2", (2) is "3", and (3) is "4"; it may be confusing and ugly, but still should work & not leave out any quarters ...

    Think of why this function exists. Someone probably thought that:

        String[] quarters = getQuarters();
        for ( ... ) {
        }
    

    was [i]a possible customization point[i] not provided by duplication of statements such as:

        String[] quarters = new String[]{"1", "2", "3", "4"};
        for ( ... ) {
        }
    

    Well, yes. But if you do it that way, then if the calendar gets changed and the number of quarters in a year becomes three or five, you've got to make updates all through your code. Having a single public constant that's used to build your arrays lets you make a change in just one spot that can break all of your code at once.

  • (cs) in reply to gallier2
    gallier2:
    frits:
    That's not very polite. Do you think we don't know how to check if a number is in a range? We do. Probably every one of us. Even the dumb ones.

    There seem to be people who think that the original code was not that bad. May be they were joking, but having followed comments here for several years now, there's no doubt that there are people dense enough, to not get why the original code was a WTF.

    Well it certainly is fortuitous that the same types of people who produce such crappy code just happen to read this site.

  • eVil (unregistered) in reply to gallier2
    gallier2:
    frits:
    That's not very polite. Do you think we don't know how to check if a number is in a range? We do. Probably every one of us. Even the dumb ones.

    You think you were polite? And did you follow the quotes in my post? There seem to be people who think that the original code was not that bad. May be they were joking, but having followed comments here for several years now, there's no doubt that there are people dense enough, to not get why the original code was a WTF. Furthermore, some people prefer comments with content. 'frist', "wooden table" and "bobby tables" comments have been boring since their first time they were posted.

    Maybe you ought to read the comments more thoroughly, and read further down, where people have asked questions, discussed answers, and corrected themselves.

    Just because someone is incorrect does not make them dumb... Generally it means they are not in possession of all the facts and have made some reasonable but incorrect assumptions to fill the gaps.

    Then again. maybe you ought to just WTF off!

  • Mez (unregistered)

    Adam Smith?? using Regex's to do anything and everything.

    Why do I have a feeling this came from our company? :(

    (Captcha: nulla - a function to set something NULL)

  • Dave-Sir (unregistered) in reply to BlueCollarAstronaut
    BlueCollarAstronaut:
    This one was pretty awesome: // ATTENTION: IF SOMEONE READS BLOCKS OF CODE ABOVE AND BELOW // THIS LINE - PLEASE DONT TRY TO UNDERSTAND IT - I DON'T

    There are places I may need to borrow that comment.

    At a PPOE, I found some code with the folling comment in the header:

    // Here be dragons!

  • Rfoxmich (unregistered)

    /**

    • @param str The string which must put into 2 Signle Quat
    • @return The single quated String */ public String SingleQautedString(String str) { return "'" + str + "'"; }

    TRWTF is that if str has embedded quats then you need to excap it with something like a backslush...and deal with exapping backslushes in the string as well... single-quating isn't so easy.

  • gallier2 (unregistered) in reply to eVil
    eVil:
    Maybe you ought to read the comments more thoroughly, and read further down, where people have asked questions, discussed answers, and corrected themselves.

    I don't see why my original comment was not contributing towards that goal. It was not condescending and it contributed to the subject. That other comments were posted, that basically stated the same as mine, during the time I wrote it (I was interrupted while composing) is irrelevant (and as frits noticed, we're not on stackoverflow were such thing would have been noticeable).

    eVil:
    Just because someone is incorrect does not make them dumb...

    Just because someone is dumb does not make them (in)correct...

    eVil:
    Generally it means they are not in possession of all the facts and have made some reasonable but incorrect assumptions to fill the gaps.

    Gaps filled with comments like I did.

    eVil:
    Then again. maybe you ought to just WTF off!

    Bye, bye

  • Leo (unregistered) in reply to 1000 monkeys
    1000 monkeys:
    frits:
    "I found this code at the day job (a large bank)," notes Dave, "maybe it's just me, but I would think a single 'if' statement could have done the job."
    You don't even need an 'if' statement...
    bolMatch = 
    (Enumerable.Range(3000, 300).Where(Function(x) x = val).Count() > 0 Or _
     Enumerable.Range(3351, 91).Where(Function(x) x = val).Count() > 0 Or _
     Enumerable.Range(5964, 6).Where(Function(x) x = val).Count() > 0) 
    

    fixed?

    if cint(val)=cint(3000) then bolMatch=true end if if cint(val)=cint(3001) then bolMatch=true end if if cint(val)=cint(3002) then bolMatch=true end if if cint(val)=cint(3003) then bolMatch=true end if if cint(val)=cint(3004) then bolMatch=true end if if cint(val)=cint(3005) then bolMatch=true end if if cint(val)=cint(3006) then bolMatch=true end if ...

    Looks like magic numbers to me.

    #define THREE_THOUSAND 3000 #define THREE_THOUSAND_AND_ONE 3001 #define THREE_THOUSAND_AND_TWO 3002 ... #define THREE_THOUSAND_THREE_HUNDRED_AND_FIFTY_ONE 3351

    if cint(val)=cint(THREE_THOUSAND) then bolMatch=true end if if cint(val)=cint(THREE_THOUSAND_AND_ONE) then bolMatch=true end if ...

  • Boobmaster (unregistered) in reply to Macho
    Macho:
    When I look into snipped Adam Smith sent, all I see is

    (.) (.)

    Boobies!

  • trtrwtf (unregistered) in reply to gallier2
    gallier2:
    Bye, bye

    Quickest meltdown in tdwtf history? Guy went to pieces so fast he took out Nagesh with the shrapnel!

    (stolen, yes, but stolen with love)

  • Jay (unregistered)

    I don't think the QUARTERS_IN_YEAR is all that dumb.

    Sure,

    String[] quarters=new String[QUARTERS_IN_YEAR]
    

    probably adds nothing to the comprehensibility of the code over

    String[] quarters=new String[4]
    

    I'm sure anyone smart enough to understand the code can figure out that 4 is the logical number of quarters and requires no further explanation.

    But what happens when we get a little farther in the code and we come across a statement that reads:

    for (int n=0;n<4;++n)
    

    Now a reader might well ask, Why 4? What is this counting over? What's magic about 4? But:

    for (int n=0;n<QUARTERS_IN_YEAR;++n)
    </pre>
    

    makes the intent clear.

    And once we create such a symbolic constant, we ought to use it everywhere. Do we really want to go through the code and say, "Oh, here it's obvious why we're using 4 so I'll hard-code the number, but over here it's ambiguous, so I'll use the symbolic constant. And this one, hmm, that's debateable, I'd better take a survey of all the programmers in the department and see how many understand the intent if I hard-code the constant." That would be a massive waste of thinking time. Once you've created the constant, just use it.

    The above is doubly true for constants that might change. In the case of quarters, okay, it's not likely that we'll have a calendar reform and start having 5 quarters in a year. (Though another poster did bring up a case where he in fact had to deal with 3 quarters in a year.) But if it's something like, say, number of regions, if some places that's hard-coded and some place we use a symbol, and then we change the number of regions, someone could easily be fooled into thinking that changing the constant solves the problem.

  • Jay (unregistered)

    BTW, even seemingly obvious constants are not always so obvious. Like, how many weeks are in a year? Obviously 52, right? Well, not really, there are 52 weeks plus an extra day, 2 in leap years. My previous employer dealt with that by every 4 or 5 years having 53 weeks in the calendar.

  • Jay (unregistered) in reply to frits
    frits:
    gallier2:
    frits:
    This isn't Stack Overflow. Nobody is actually trying to correct or improve the code. Except you.

    Eat shit. You're not in charge of defining what is appropriate or not to post on this blog.

    That's not very polite. Do you think we don't know how to check if a number is in a range? We do. Probably every one of us. Even the dumb ones.

    Mommy! Mommy! He started a fight! He hit me back!

  • (cs) in reply to Leo
    Leo:
    #define THREE_THOUSAND 3000 #define THREE_THOUSAND_ONE 3001 #define THREE_THOUSAND_TWO 3002 ... #define THREE_THOUSAND_THREE_HUNDRED_FIFTY_ONE 3351

    if cint(val)=cint(THREE_THOUSAND) then bolMatch=true end if if cint(val)=cint(THREE_THOUSAND_ONE) then bolMatch=true end if ...

    FTFY.

    This post has been sponsored by your grade three teacher.

  • trtrwtf (unregistered) in reply to Jay
    Jay:
    BTW, even seemingly obvious constants are not always so obvious. Like, how many weeks are in a year? Obviously 52, right? Well, not really, there are 52 weeks plus an extra day, 2 in leap years. My previous employer dealt with that by every 4 or 5 years having 53 weeks in the calendar.

    365%52 != 0 Years aren't composed of weeks - a given date is within week N of a given year, determined by Julian date and your conception of where the week is bounded. If your calendar of the year has a set number of weeks you're doing something wrong.

  • (cs) in reply to eVil
    eVil:
    pjt33:
    eVil:
    A sinlge if could probably do the job, but surely you'd have to write some pretty inglorious code to achieve that.

    As it stands, the code is readable and efficient, so I dont see what you'd gain by refactoring it?

    Efficient? Using a loop through a contiguous range of values to check whether a value is in that range?

    Not knowing exactly which language that was, I just assumed that cint() was some kind of array of values being indexed into... is this not the case?

    YOU WISH! It's a fucking cast to int. God I hate VB.

  • Jerry (unregistered) in reply to Jay
    Jay:
    BTW, even seemingly obvious constants are not always so obvious. Like, how many weeks are in a year? Obviously 52, right? Well, not really, there are 52 weeks plus an extra day, 2 in leap years. My previous employer dealt with that by every 4 or 5 years having 53 weeks in the calendar.
    Weeks don't fit into months or years, months aren't all the same size, even years have a variable number of days... and don't get me started with hours minutes and seconds that don't multiply by something reasonable but instead by 24 or 60... human time reckoning is a mess!

    What is needed is to replace all time measurements and expressions by a simple integer counter of http://en.wikipedia.org/wiki/Planck_time since the Big Bang.

    OK we might have to show it in hex instead of decimal, so it doesn't take up quite so much room.

  • Iceman (unregistered)
    if (GlobalConfig["UseSpellingError"]) { pKey = pKey.replace("gb_custom", "gb_costum"); }

    This not a WTF. This is normally used when a old version of some config file used a config option with a spelling error. In a new version you fix the spelling error, but have a compatible option for the old spelling. This way you don't need to update all config files everywhere, but new files will be correct. This is called backward compatibility.

  • (cs) in reply to Jay
    Jay:
    BTW, even seemingly obvious constants are not always so obvious. Like, how many weeks are in a year? Obviously 52, right? Well, not really, there are 52 weeks plus an extra day, 2 in leap years. My previous employer dealt with that by every 4 or 5 years having 53 weeks in the calendar.
    I like how c is slowing down as magnetic force increases. That's what I think of as a non-obvious non-constant.

    52 weeks in a year not being a constant is about as obvious as it gets.

  • (cs) in reply to Iceman
    Iceman:
    if (GlobalConfig["UseSpellingError"]) { pKey = pKey.replace("gb_custom", "gb_costum"); }

    This not a WTF. This is normally used when a old version of some config file used a config option with a spelling error. In a new version you fix the spelling error, but have a compatible option for the old spelling. This way you don't need to update all config files everywhere, but new files will be correct. This is called backward compatibility.

    Or you could make it work properly. This is called "fixing the problem".
  • Al (unregistered) in reply to hoodaticus
    hoodaticus:
    I like how c is slowing down as magnetic force increases.
    Einstein arbitrarily chose c (in a vacuum) as the only constant. Everything else has to distort to fit. So if light doesn't quite cover 186,000 miles per second any more, it can only mean that the miles have grown longer. Or perhaps seconds are shorter.

    I blame George Bush and Obama. They have not been taking their responsibilities seriously.

  • Brompot (unregistered) in reply to Ahem...
    Ahem...:
    Not only are there always four quarters in a year, there are also always four quarters in a dollar, four quarters in an apple... I think the brighter ones among us can see where I'm going with this...
    const QUARTERS = 4;
    Done!

    But there are two quarters in half a dollar and 20 quarters in a fiver. 40 quarters in a decade and two quarters in a semester.

    You're making the assumption that this is about one whole object (i.e. one whole year). But if you want to change the program to work in semesters...

    It's people like you that keep us programmers working whenever the world changes. Thank you.

  • (cs) in reply to Ken Jennings
    Ken Jennings:
    I'll take "Non-Subtle Attempts to Start a Flamewar" for 100, Alex.
    I see what you did!
  • silent d (unregistered) in reply to dgvid
    dgvid:
    D-Coder:
    ... Words are more explanatory than numbers in almost all cases.

    A word is worth one-thousand numbers.

    FTFY

    #define NUMBER_OF_NUMBERS_THAT_A_WORD_IS_WORTH 1000

  • the beholder (unregistered) in reply to gallier2
    gallier2:
    frits:
    This isn't Stack Overflow. Nobody is actually trying to correct or improve the code. Except you.

    Eat shit. You're not in charge of defining what is appropriate or not to post on this blog.

    Whoa there. You may feel entitled to post your code correction here and there's nothing wrong with it per se, but there's a side effect you should consider whenever you do that.

    I've seen a few TDWTF articles over the years where someone posts new code to do whatever the article's code was supposed to. Unfortunately the code posted was broken too and in a too obvious way; and then people started posting their (for the most part completely wrong) solutions to a problem they didn't even understand. I think this last one regarded memory management in C, AFAICR.

    There were obvious syntactic and logical errors all around but above all their code didn't even touch the requirements. I stopped reading after I saw that it was the freaking third page and people were still posting flawed code even after someone got it right on the end of first page. It was impossible to find smart comments in the middle of it all.

    I believe frits is trying to discourage this sort of behavior here. It's sort of an unwritten rule, and I support it fully.

  • (cs) in reply to the beholder
    the beholder:
    gallier2:
    frits:
    This isn't Stack Overflow. Nobody is actually trying to correct or improve the code. Except you.

    Eat shit. You're not in charge of defining what is appropriate or not to post on this blog.

    Whoa there. You may feel entitled to post your code correction here and there's nothing wrong with it per se, but there's a side effect you should consider whenever you do that.

    I've seen a few TDWTF articles over the years where someone posts new code to do whatever the article's code was supposed to. Unfortunately the code posted was broken too and in a too obvious way; and then people started posting their (for the most part completely wrong) solutions to a problem they didn't even understand. I think this last one regarded memory management in C, AFAICR.

    There were obvious syntactic and logical errors all around but above all their code didn't even touch the requirements. I stopped reading after I saw that it was the freaking third page and people were still posting flawed code even after someone got it right on the end of first page. It was impossible to find smart comments in the middle of it all.

    I believe frits is trying to discourage this sort of behavior here. It's sort of an unwritten rule, and I support it fully.

    If you expect to find smart comments here, you've missed frits' point.

  • gallier2 (unregistered) in reply to the beholder
    the beholder:
    gallier2:
    frits:
    This isn't Stack Overflow. Nobody is actually trying to correct or improve the code. Except you.

    Eat shit. You're not in charge of defining what is appropriate or not to post on this blog.

    Whoa there. You may feel entitled to post your code correction here and there's nothing wrong with it per se, but there's a side effect you should consider whenever you do that.

    I've seen a few TDWTF articles over the years where someone posts new code to do whatever the article's code was supposed to. Unfortunately the code posted was broken too and in a too obvious way; and then people started posting their (for the most part completely wrong) solutions to a problem they didn't even understand. I think this last one regarded memory management in C, AFAICR.

    There were obvious syntactic and logical errors all around but above all their code didn't even touch the requirements. I stopped reading after I saw that it was the freaking third page and people were still posting flawed code even after someone got it right on the end of first page. It was impossible to find smart comments in the middle of it all.

    I believe frits is trying to discourage this sort of behavior here. It's sort of an unwritten rule, and I support it fully.

    Yeah, well you're a big poopyhead too.

  • JayC (unregistered) in reply to hoodaticus
    hoodaticus:
    Iceman:
    if (GlobalConfig["UseSpellingError"]) { pKey = pKey.replace("gb_custom", "gb_costum"); }

    This not a WTF. This is normally used when a old version of some config file used a config option with a spelling error. In a new version you fix the spelling error, but have a compatible option for the old spelling. This way you don't need to update all config files everywhere, but new files will be correct. This is called backward compatibility.

    Or you could make it work properly. This is called "fixing the problem".

    Oh, you mean, like obliterating any trace of monsters such as IE6 from the planet? I'd love to hear your proposals.

  • (cs) in reply to x
    x:
    eVil:
    A sinlge if could probably do the job, but surely you'd have to write some pretty inglorious code to achieve that.

    As it stands, the code is readable and efficient, so I dont see what you'd gain by refactoring it?

    Not sure about my VB syntax, but why not this :

    bolMatch=(cint(val) >= 3000 and cint(val) <= 3299) or (cint(val) >= 3351 and cint(val) <= 3441) or (cint(val) >= 5964 and cint(val) <= 5969)

    or that ?

    if cint(val) >= 3000 and cint(val) <= 3299 then bolMatch=true else if cint(val) >= 3351 and cint(val) <= 3441 then bolMatch=true else if cint(val) >= 5964 and cint(val) <= 5969 then bolMatch=true

    Yeah, that cint's a cunt, innit

  • gallier2 (unregistered) in reply to trtrwtf
    trtrwtf:
    gallier2:
    Bye, bye

    Quickest meltdown in tdwtf history? Guy went to pieces so fast he took out Nagesh with the shrapnel!

    (stolen, yes, but stolen with love)

    That's what you think.

  • trtrwtf (unregistered) in reply to JayC
    JayC:
    hoodaticus:
    Iceman:
    if (GlobalConfig["UseSpellingError"]) { pKey = pKey.replace("gb_custom", "gb_costum"); }

    This not a WTF. This is normally used when a old version of some config file used a config option with a spelling error. In a new version you fix the spelling error, but have a compatible option for the old spelling. This way you don't need to update all config files everywhere, but new files will be correct. This is called backward compatibility.

    Or you could make it work properly. This is called "fixing the problem".

    Oh, you mean, like obliterating any trace of monsters such as IE6 from the planet? I'd love to hear your proposals.

    I say we take off and nuke it from orbit. It's the only way to be sure.

  • gallier2 (unregistered) in reply to the beholder
    the beholder:
    gallier2:
    frits:
    This isn't Stack Overflow. Nobody is actually trying to correct or improve the code. Except you.

    Eat shit. You're not in charge of defining what is appropriate or not to post on this blog.

    Whoa there. You may feel entitled to post your code correction here and there's nothing wrong with it per se, but there's a side effect you should consider whenever you do that.

    I've seen a few TDWTF articles over the years where someone posts new code to do whatever the article's code was supposed to. Unfortunately the code posted was broken too and in a too obvious way; and then people started posting their (for the most part completely wrong) solutions to a problem they didn't even understand. I think this last one regarded memory management in C, AFAICR.

    There were obvious syntactic and logical errors all around but above all their code didn't even touch the requirements. I stopped reading after I saw that it was the freaking third page and people were still posting flawed code even after someone got it right on the end of first page. It was impossible to find smart comments in the middle of it all.

    I believe frits is trying to discourage this sort of behavior here. It's sort of an unwritten rule, and I support it fully.

    I don't, and now?

  • gallier2 (unregistered) in reply to gallier2
    gallier2:
    trtrwtf:
    gallier2:
    Bye, bye

    Quickest meltdown in tdwtf history? Guy went to pieces so fast he took out Nagesh with the shrapnel!

    (stolen, yes, but stolen with love)

    That's what you think.

    Hey, there's only room for one fake gallier2 around here, and I'm him.

  • (cs) in reply to me
    me:
    Produce is chicken wing. With wing bark. No Qautk.
    +1 FTW
  • gallier2 (unregistered) in reply to gallier2
    gallier2:
    the beholder:
    gallier2:
    frits:
    This isn't Stack Overflow. Nobody is actually trying to correct or improve the code. Except you.

    Eat shit. You're not in charge of defining what is appropriate or not to post on this blog.

    Whoa there. You may feel entitled to post your code correction here and there's nothing wrong with it per se, but there's a side effect you should consider whenever you do that.

    I've seen a few TDWTF articles over the years where someone posts new code to do whatever the article's code was supposed to. Unfortunately the code posted was broken too and in a too obvious way; and then people started posting their (for the most part completely wrong) solutions to a problem they didn't even understand. I think this last one regarded memory management in C, AFAICR.

    There were obvious syntactic and logical errors all around but above all their code didn't even touch the requirements. I stopped reading after I saw that it was the freaking third page and people were still posting flawed code even after someone got it right on the end of first page. It was impossible to find smart comments in the middle of it all.

    I believe frits is trying to discourage this sort of behavior here. It's sort of an unwritten rule, and I support it fully.

    Yeah, well you're a big poopyhead too.

    Thank you to stand in for me, but I woudn't have come up with 'poopyhead'. I have to admit though, that I like it.

  • gallier2 (unregistered) in reply to gallier2
    gallier2:
    gallier2:
    trtrwtf:
    gallier2:
    Bye, bye

    Quickest meltdown in tdwtf history? Guy went to pieces so fast he took out Nagesh with the shrapnel!

    (stolen, yes, but stolen with love)

    That's what you think.

    Hey, there's only room for one fake gallier2 around here, and I'm him.

    This one isn't fake (can be noticed in my approximative english and my overly pedantic rants).

Leave a comment on “SingleQautedString(), RemoveMeFunction(), Human-Friendly Dates, and More”

Log In or post as a guest

Replying to comment #:

« Return to Article