• nickhead (unregistered)

    wow

  • Phreakbert (unregistered)
    if (postIndex == 0)
    {
        System.out.println("Frist psot!");
    }
    else
    {
        System.out.println("Frist psot!");
    }
    
  • lazybutregistereduser (unregistered)

    blame the submitter, not the poorly-designed viewer you chose to use. WTF?

  • Welbog (cs) in reply to Phreakbert

    That was pretty good. Too bad you weren't first, though.

  • vt_mruhlin (cs)

    What does the + @ do in JavaScript? Robust parameters or something?

  • bonzombiekitty (cs)

    sheeesh. not only is the first one an "are you sure", it's a completely useless if statement. I can understand making a seperate function for it because it's clearer, and takes less typeing if you need to call it multiple times, but why bother with an if statement in the first place if you are going to return the table if it's null or not. Just do a

    return document.getElementById('" + gridPanelTable.ClientID + @"')

  • Publius (unregistered)

    The last example is foolish. It looks the programmer was just trying to remind themselves to add code to these sections later. How is that bad?

  • I4,5 (unregistered)

    file_exists() will be cached, so even if you deleted the file in middle of the check, it won't check it's real file existance...

  • snoofle (unregistered) in reply to Phreakbert

    No no no! You're all missing the point. This is part of a threaded system, and the multiple checks take long enough that the requested resource exists by the second time around! </sarcasm>

  • ewww (unregistered)

    And why does it bother you if we submit something with the same title as a previous article?

  • Vischar (cs) in reply to ewww
    ewww:
    And why does it bother you if we submit something with the same title as a previous article?

    Who cares? Maybe just do what he asks to increase your chances of getting your submission read... or don't and get your submission overlooked.

    shrug

  • mrprogguy (cs)

    There has to be a problem in the transcription of the JavaScript, because what I'm seeing should always return null (given a rational analysis of the argument to the getElementById call).

    The problem is that

    document.getElementById('" + gridPanelTable.ClientID + @"')

    queries for an element called

    " + gridPanelTable.ClientID + @"

    and I refuse to believe that someplace in the HTML you'd find

    id='" + gridPanelTable.ClientID + @"' class="gridTable">

    Could it be that the transcription is missing some quotes? Or should that be

    document.getElementById(gridPanelTable.ClientID + "@")
    ?
  • madjo (cs) in reply to Vischar
    Vischar:
    ewww:
    And why does it bother you if we submit something with the same title as a previous article?

    Who cares? Maybe just do what he asks to increase your chances of getting your submission read... or don't and get your submission overlooked.

    shrug

    So for one to submit a new entry that person is supposed to know the title of every story on this site? I'm all for less work for the editors, but don't expect the impossible!

  • David Oster (unregistered)

    In the cute prose header for this article, the author refers to "pi-calculus". Surely, this is the wrong greek letter, and he meant "lambda-calculus".

  • [twisti] (unregistered) in reply to David Oster

    With quality CodeSOTDs like "OMG LOLZ LOOK HE WROTE THE IF WRONG ROFFLZ!" I can certainly see why he would skip submissions based on their title.

  • headshit (unregistered)

    This isn't a What The Fuck. A What The Fuck, is some dumbass claiming that "doubleyou-tee-eff" was offensive to his senile grandma, and that "Worse Than Failure" makes a lick of fucking sense.

  • Vischar (cs) in reply to madjo
    madjo:
    Vischar:
    ewww:
    And why does it bother you if we submit something with the same title as a previous article?

    Who cares? Maybe just do what he asks to increase your chances of getting your submission read... or don't and get your submission overlooked.

    shrug

    So for one to submit a new entry that person is supposed to know the title of every story on this site? I'm all for less work for the editors, but don't expect the impossible!

    I doubt he would mention it if it was a problem that was happening every now and then coincidentally.

    Coming up with a name for your submission that hasn't been used in a previous article (even if you didn't have a list of previous articles) would be a horrible plot for Mission Impossible 4... Tom Cruise is probably crazy enough to take it tho...

  • bobday (cs)

    I think the first sample is actually a C# string in an ASP.NET page with the initial @" missing.

  • CapitalT (cs) in reply to David Oster
    David Oster:
    In the cute prose header for this article, the author refers to "pi-calculus". Surely, this is the wrong greek letter, and he meant "lambda-calculus".

    Say what?

    Don't talk out of your ass please. (the comments page is worthless)

  • Derrick Pallas (cs) in reply to ewww
    ewww:
    And why does it bother you if we submit something with the same title as a previous article?

    Because I've got it cached as being done already.

  • Derrick Pallas (cs) in reply to [twisti]
    [twisti]:
    With quality CodeSOTDs like "OMG LOLZ LOOK HE WROTE THE IF WRONG ROFFLZ!" I can certainly see why he would skip submissions based on their title.

    Tomorrow, we're going to get a dozen emails with titles like "Deterministic Programming" and "Deterministic Programming Too!" where the submission is essentially one of the code snippets in today's article. There is a 50/50 that some of the text will be a paraphrase of something I've already written. The worse my prose is, the higher the chances.

  • headshit (unregistered) in reply to Derrick Pallas
    Derrick Pallas:
    ewww:
    And why does it bother you if we submit something with the same title as a previous article?

    Because I've got it cached as being done already.

    Well gee, numbnuts -- seems there's a What The Fuck in your logic. How the shit is someone supposed to know if a title's been taken? Do a search every goddamned time?

  • Misha (unregistered) in reply to headshit
    Comment held for moderation.
  • Vischar (cs) in reply to Misha
    Misha:
    Hmm, the URL of this article is http://worsethanfailure.com/Articles/Deterministic-Programming.aspx

    So if (speaking purely hypothetically) I wanted to submit one titled "headshit is a brainless prat", perhaps I could type http://worsethanfailure.com/Articles/Headshit-Is-A-Brainless-Prat.aspx into my address bar?

    Wow, that must have taken me almost 20 seconds. I better go have a lie down.

    Bravo!

    Wow, 20 seconds... headshit types slow...

  • headshit (unregistered) in reply to Misha
    Comment held for moderation.
  • Vischar (cs) in reply to headshit
    headshit:
    Misha:
    Hmm, the URL of this article is http://worsethanfailure.com/Articles/Deterministic-Programming.aspx

    So if (speaking purely hypothetically) I wanted to submit one titled "headshit is a brainless prat", perhaps I could type http://worsethanfailure.com/Articles/Headshit-Is-A-Brainless-Prat.aspx into my address bar?

    Wow, that must have taken me almost 20 seconds. I better go have a lie down.

    huh? It took you almost 20 seconds to do something that has nothing to do with my point? score!

    You had a point?!

    Irish Accent Brilliant!

  • iToad (unregistered)

    The third example is a new way to write provably correct software. No code, no bugs.

  • Ibn al-Hazardous (unregistered) in reply to Publius
    Comment held for moderation.
  • LintMan (unregistered)

    I'd bet in all of these cases that originally the code had a different conditional for one of the cases (and code in the braces in the third). Then things got munged (or removed) during the debug process and never cleaned up.

    That's really lousy programming, but not really WTF-class, IMHO. I doubt the original coder was trying for the "are you sure?" effect or the "condition branches that have no effect" effect, which is what the into implies.

  • anonymous (unregistered) in reply to LintMan
    LintMan:
    I'd bet in all of these cases that originally the code had a different conditional for one of the cases (and code in the braces in the third). Then things got munged (or removed) during the debug process and never cleaned up.

    Especially in the BatchProcessor.ProcessBatch() case, this might be an attempt to avoid changing lines (and thus being the one people go to when that code has problems). In fact, if you do an annotate of only the latest version, whoever took code out of those branches doesn't show up at all. Brillant!

  • BAReFOOt (unregistered)

    WTF has Firfox to do with you Mail allachments? DO you know the difference between a mail client and a browser? (Don't tell me about wembailers. Imagining Alex being such a noob that he uses webmailers for his submissions either lets eider me burst out in tears or my head explode to paint the walls. ;)

  • mattnaik (unregistered) in reply to headshit
    headshit:
    This isn't a What The Fuck. A What The Fuck, is some dumbass claiming that "doubleyou-tee-eff" was offensive to his senile grandma, and that "Worse Than Failure" makes a lick of fucking sense.

    seriously, get over it already.

  • Malfist (unregistered) in reply to mattnaik
    mattnaik:
    headshit:
    This isn't a What The Fuck. A What The Fuck, is some dumbass claiming that "doubleyou-tee-eff" was offensive to his senile grandma, and that "Worse Than Failure" makes a lick of fucking sense.

    seriously, get over it already.

    Really, moron.

  • Derrick Pallas (cs) in reply to BAReFOOt
    BAReFOOt:
    WTF has Firfox to do with you Mail allachments? DO you know the difference between a mail client and a browser?

    I don't know what an allachment is but maybe you've heard of Gmail.

  • BradleyS (cs) in reply to headshit
    headshit:
    This isn't a What The Fuck. A What The Fuck, is some dumbass claiming that "doubleyou-tee-eff" was offensive to his senile grandma, and that "Worse Than Failure" makes a lick of fucking sense.

    Hmm...red title bar, by Derrick Pallas...you know, I do believe you're right. It's NOT a WTF. It's a CSOD, which you'd realize if you were here for any reason other than to complain about a minor name change to the site.

  • bah (unregistered)

    Typically you see code like this mostly because of bad integrations using source control. The auto-merge function isn't all that smart and bad checkin policy could cause things like this to be missed

  • Eric (unregistered)

    These likely aren't WTFs but are just the result of someone doing a copy paste and forgetting to change what he pasted. I 've done this many times, but I usually find it before checking the code in.

  • psiphiorg (cs) in reply to BradleyS
    BradleyS:
    Hmm...red title bar [...] It's a CSOD
    What red title bar? The titles on: http://worsethanfailure.com/Articles/Deterministic-Programming.aspx and: http://worsethanfailure.com/Comments/Deterministic-Programming.aspx are both grey on white, just like any other page. Not a drop of red to be seen, other than in the site logo, which appears to always be red.

    The moral of the story is either (a) Don't assume people read these from the front page, or (b) Maybe the article page titles should be displayed in the same color as they appear on the front page, depending on whether you're a reader or a site admin.

    davidh

  • FredSaw (cs)

    Here's how that javascript really went down.

    System.Text.StringBuilder sb = new System.Text.StringBuilder(5000);
    sb.Append(@"function GetGridTable()");
    sb.Append(@"{");
    sb.Append(@"    if (document.getElementById('" + gridPanelTable.ClientID + @"') != null)");
    sb.Append(@"    {");
    sb.Append(@"        return document.getElementById('" + gridPanelTable.ClientID + @"');");
    // ...etc.
    sb.Append(@"}");
    Page.RegisterClientScriptBlock(sb.ToString());
    
  • Joseph Newton (unregistered) in reply to mrprogguy
    Comment held for moderation.
  • Faxmachinen (cs) in reply to Derrick Pallas
    Derrick Pallas:
    I don't know what an allachment is but maybe you've heard of Gmail.
    How charming. Say, you haven't considered getting a real email account?
  • Joseph Newton (unregistered) in reply to BAReFOOt
    BAReFOOt:
    WTF has Firfox to do with you Mail allachments? DO you know the difference between a mail client and a browser? (Don't tell me about wembailers. Imagining Alex being such a noob that he uses webmailers for his submissions either lets eider me burst out in tears or my head explode to paint the walls. ;)

    Perhaps Alex values his operating system and mail archive. Webmail is actually a very effective means of pre-filtering mail before it enters your local machine. Given that AV software is wont to do brilliant favors for the user, such as quarantining an entire mail file because one message happens to have a virus attachment, this can save a lot of time and trouble.

    I've been doing this for about 18 months now, and I just wish I had started years earlier.

  • Jon (unregistered) in reply to lazybutregistereduser
    lazybutregistereduser:
    blame the submitter, not the poorly-designed viewer you chose to use. WTF?
    Sending it as an attachment introduces an extra step before Derrick can view the submission and has no advantages. A little common sense goes a long way.
  • Anonymous (unregistered) in reply to Vischar
    Vischar:
    Who cares? Maybe just do what he asks to increase your chances of getting your submission read... or don't and get your submission overlooked. *shrug*

    People aren't going to jump through hoops and adhere to multiple arbitrary criteria in a fairly small, informal community. If Alex starts discarding stuff, that's his prerogative, but don't expect people to care.

  • Vischar (cs) in reply to Anonymous
    Anonymous:
    Vischar:
    Who cares? Maybe just do what he asks to increase your chances of getting your submission read... or don't and get your submission overlooked. *shrug*

    People aren't going to jump through hoops and adhere to multiple arbitrary criteria in a fairly small, informal community. If Alex starts discarding stuff, that's his prerogative, but don't expect people to care.

    Thanks... that's exactly why my post started with "Who cares?"

  • Anonymous (unregistered)
    Comment held for moderation.
  • Rank Amateur (cs)

    Code like this could be simplified with a properly designed language. I've long argued for a Really Equivalent operator. I suggest ===. That of course also allows for the !== operator, which means "equivalent but not really equivalent," not to be confused with !!=, which means "really definitely not equivalent." --Rank

  • KenW (cs) in reply to ewww
    ewww:
    And why does it bother you if we submit something with the same title as a previous article?

    I don't know... Why does it bother me when people ask stupid questions?

  • TheJasper (cs) in reply to Anonymous
    Anonymous:
    >... is a good way to convince me to not look at the submission...

    The WTF is that, on the submission page, it's written "I do, however, read every message."

    Yes, but for the one's with title's he's seen before he prints the out in braille and then reads with his hands. He still doesn't look at it though. ;}

    I would like to say that the somewhat hostile tone and rude language that some people insist on using is really annoying. There is no need to be insulting, except sometimes as a joke. I wouldn't mind at all for such posts to be removed. It's not that I care about the language used but more the hostile intent.

  • slapout (unregistered)

    "Please stop doing that too."

    Are you talking to submitters or Firefox?

Leave a comment on “Deterministic Programming”

Log In or post as a guest

Replying to comment #:

« Return to Article