• (disco)

    var aLeapYears =   new Array(1900,1904,1908,1912,1916,...

    Bzzzzt!

        2060) //please god let this be far enough??

    Good, because he/she/it would likely have screwed up again at 2100.

    Support : I'm telling you, nothing changed!!! The only difference between the old version and the new version is that the old version was in COBOL, and the new one is in C!!!

    I literally :facepalm:ed at this one.

  • (disco)

    Your Christmas present this year is a pile of WTFs from back in 2005.

    You would think this article would get proofread after 10 years, but no:

    The customer service at Jason Harmon's job had been telling clients that the bad data coming seen in their system was a configuraitotion problem,
    Shayne Studdard chuckled at the original author's comment

    Filed under: Classic mistakes, Nothing to see here

  • (disco) in reply to JBert
    JBert:
    > The customer service at Jason Harmon's [job] had been telling clients that the **bad data coming seen in their system** was a configuraiton problem,

    I'm not convinced that's necessarily any better..

  • (disco) in reply to PJH

    That word was in the original copy.

    Hmmm, now I wonder if our insert / delete markers can be used in quotes instead of just bold...


    EDIT: There, fixed.

  • (disco)

    And ten years later,

    coming seen in their system was a configuraiton problem

    is still going strong. Little too much spiked eggnog, Santa?

  • (disco) in reply to HardwareGeek

    Yep, know what you mean.. :smile:

    But who can blame a hell-desk guy for assuming that rewriting a complete application in a completely new language can not possibly create any bugs.....

    But I would suggest that hell-desk guy to switch to flipping burgers, less WTF's that way, but then again, this site would be more boring.

  • (disco) in reply to Yazeran
    But who can blame a hell-desk guy for assuming that rewriting a complete application in a completely new language can not possibly create any bugs.....

    Oh, I can go one better ... project proposal earlier this year: "We will avoid this technical risk [excessive test/bug-fixing workload] by producing multiple prototype applications in different languages". Yes, actually thinking that developing the project multiple times in different ways would be easier than testing and debugging it properly ...

  • (disco) in reply to jas88

    http://dilbert.com/strip/1994-10-17

  • (disco) in reply to Yazeran
    Yazeran:
    But I would suggest that hell-desk guy to switch to flipping burgers

    Thanks for ruining burgers for me. In the future I'll always imagine my burgers being flipped by such a guy, and then I'd rather starve or eat them raw.

  • (disco) in reply to PWolff

    Well My job here is done as I have now done my part to improve world health by preventing you from getting cardiovascular problems in the future :grinning:

  • (disco)

    Wait a second... the padding one doesn't actually zero-pad.

  • (disco) in reply to jas88

    FYI, that's called N-version programming, and it was debunked pretty thoroughly back in the eighties. People make the exact same mistakes, regardless of which language or framework they are using.

  • (disco)

    I do the second to last one sometimes. If the code that can fail and the prior code that prevents it from failing are too far apart to not fit on the same screen, my brain gets nervous and goes into "can't be too cautious" mode.

  • (disco) in reply to Buddy
    Buddy:
    People make the exact same mistakes, regardless of which language or framework they are using.

    If the mistakes are characteristic of the problem domain, yes. If the mistakes are characteristic of the programming language, no. Unless the different languages used to make the versions are similar. (For example, Ruby and Python have pretty similar semantic models on some levels, and will attract some similar language-induced problems. You'd get different ones with OCaml.)

    There's no assurance that producing lots of versions will give you a bug-free version. Not unless one of those versions happens to be done with the aid of a superb test suite…

  • (disco)

    log.fatal("Aaaaarrrgghhhh");

    This totally happened in our team. Just couldn't pin down the source of that bloody error. Only that the coder in question put in "F**ing Sht" AND the message then popped up in production with several users. We got a very loud and insistent phone call from quality management. :laughing:

  • (disco) in reply to Kensey

    It adds 0 to the front. What more can you want?

    The real wtf-ness is, of course, the

    $limit = 9999; for($i=1000;$i<$limit;$i++)

    part. Under what circumstances will i then be less than 10, 100 or 1000 ... or greater than 10000, 100000 et cetera? (And just how many further powers of 10 were snipped?) The implication is that this is a copy-and-paste function that occurs repeatedly in the code, for differing ranges of i each time. The wtfs multiply...

  • (disco) in reply to Zainab58
    Zainab58:
    It adds 0 to the front. What more can you want?

    Well, but it looks (unless I'm misreading it) like besides the goof you noted, it only ever adds a single zero, no matter what magnitude the input is. Not what I typically think of as "padding".

    Edit: Actually, I take that back. As written it looks like it adds as many zeroes to the front as the value of the input.

  • (disco) in reply to Buddy
    HardwareGeek:
    > var aLeapYears = > new Array(1900,1904,1908,1912,1916,...

    Bzzzzt!

    I looked for the 2000 error...and totally missed this one. :facepalm:

    Yazeran:
    ...a **hell**-desk guy...

    :rofl:

    Buddy:
    FYI, that's called N-version programming, and it was debunked pretty thoroughly back in the eighties. People make the exact same mistakes, regardless of which language or framework they are using.

    Absent the last step, no less.

  • (disco) in reply to dkf

    Ok, exact same mistakes was a bit of a hyperbole, but my understanding is that Knight & Leveson showed that there was a statistically significant correlation in the errors that were made, regardless of language or methodology. Its not that nvp has no effect at all, its just that the bang for buck is a lot lower than you get with proper design and testing. Especially if the spec itself could have errors in it.

    @jas88, maybe you could still salvage this. Tell them you think its a great idea, and that they should take it one level further by having one team design each unit, and have some process call that unit with a variety of inputs and record the outputs, then get the next team to implement the same unit, and check that it has the same outputs for all inputs. Et Voilà, your company just invented unit testing.

  • (disco)

    @Buddy: "one team" ... "next team" ... that would rather require the project to have a non-trivial number of developers, wouldn't it? Having a design and some sort of spec would be nice too. (At my last count it had 3 people, none more than 20% FTE.)

    So far, the goal is to track sensor input from a building .. and somehow use that to feed back into CAD systems. (Yes, plural.) They'd forgotten to mention that aspect in the funding bid though...

    Last time I was thinking about their aims, I was comparing it to the idea of a manned mission to the sun: not just impossible, but certifiably insane to contemplate in any way.

  • (disco) in reply to jas88
    jas88:
    Last time I was thinking about their aims, I was comparing it to the idea of a manned mission to the sun: not just impossible, but certifiably insane to contemplate in any way.

    Nah, you just do it at night.

    [image]
  • (disco) in reply to HardwareGeek
    HardwareGeek:
    var aLeapYears = new Array(**1900**,1904,1908,1912,1916,...
    Ah-ha - the old Excel workaround!

    Now 'scuse me while I decide whether or not to do something about

    function is_leap_year($year)
    {
        return !($year % (400 - 396 * !!($year % 100)));
    }
    
  • (disco) in reply to blakeyrat
    blakeyrat:
    Nah, you just do it at night.
    But _which_ night? https://en.wikipedia.org/wiki/2005_HC4
  • (disco)
    ```                 <input type="button" value=" Print " onclick="window.print();"> ```

    Did nobody tell that guy about different window sizes, different font sizes, and the benefits of ACNEScript?

    To the last one:

    TWTF here is that the ifs aren't nested. It would be far more effective to write

    [ ... snip ...];  //and they forgot the semicolon after the snip, too!
    if ($i<100000) {$number = "0".$number;
    if ($i<10000) {$number = "0".$number;
    [ ... snip ...];
    };
    [ ... snip ...];
    };
    
    Watson:
    But _which_ night?

    The Night Of The Space-Walking Dead, I suppose?

  • (disco) in reply to PWolff
    PWolff:
    Did nobody tell that guy about different window sizes, different font sizes, and the benefits of ACNEScript?

    <center>


    <center>Filed under: [I think DC sanitizes those away, sadly](#tag)</center>
  • (disco) in reply to Forgotmylogin1

    Files are shared resources, and it's pretty easy to run into concurrency issues. So you check if the file exists again... and cross your fingers and hope it doesn't get renamed or deleted in between

    If iFile.Exists Then
    

    and

    fileSizeBytes = iFile.Length.ToString
    

    Or you just throw in an On Error Resume Next and be done with it...

  • (disco)
    aliceif:
    ```<center>```
    Thanks for pointing this out. I forgot that
    align="center" <!-- and gotit="whoosh" -->
    is <!-- are --> deprecated meanwhile.
    anotherusername:
    Files are shared resources, and it's pretty easy to run into concurrency issues. So you check if the file exists again... and cross your fingers and hope it doesn't get renamed or deleted in between

    Especially for local files, because the idea of file locks is patented, afaik. Network files are not so much of a problem, for network connections are 100% reliable, as we learned from one of our clients*.


    * indirectly - they asked why the heck we'd rather use a local copy of a 5 KB file instead of just Doing It Right™, that is, using a web service.

  • (disco) in reply to PWolff
    PWolff:
    the idea of file locks is patented

    Was. Probably by IBM in the 1960s.

  • (disco) in reply to anotherusername
    anotherusername:
    Files are shared resources, and it's pretty easy to run into concurrency issues. So you check if the file exists again...
    int fd = open(fname, O_READ);
    struct stat st;
    
    if( fstat(fd, &st) ) {
        int bytes = st.st_size;
    }
    

    I believe nowadays you can even rename based on a file descriptor, using "/proc/self/fd/%d" as the source.

  • (disco) in reply to PleegWat

    Now do it in Visual Basic...

  • (disco) in reply to anotherusername
    anotherusername:
    Now do it in Visual Basic...

    Now do it in Brainfuck. Or BIT (hard version: without running out of disk space).

  • (disco) in reply to dkf

    Why? The original code fragment was written in Visual Basic, which is a programming language that real people actually use to do real work, quite often, like it or not.

  • (disco) in reply to anotherusername
    anotherusername:
    Visual Basic, which is a programming language that real people actually use to do real work

    But not real often on the platform that the solution that you replied to was presented for.<!-- I think I assembled that sentence correctly…? -->

  • (disco) in reply to dkf

    I never did much windows programming, so I have no idea if something like that exists on windows. If it does, it's probably in .net and hence in VB.

    I'd also initially failed to identify the snippet as VB, because back when I used VB having all keywords in all-caps was still mandatory.

  • (disco) in reply to anotherusername
    dkf:
    not real often on the platform that the solution that you replied to was presented for.

    But the original code was VB.

    [image]
    PleegWat:
    I'd also initially failed to identify the snippet as VB, because back when I used VB having all keywords in all-caps was still mandatory.

    AFAIK it was never mandatory that they be all caps, although the editor might have automatically changed them to all caps as you typed.

    Anyway, that fragment of code doesn't use curly braces, used ' for comments, and If ... Then ... Else ... End If syntax... combined, that is pretty indicative of VB (Fortran has END IF, but uses ! for comments and I don't think it supports Throw either).

  • (disco) in reply to anotherusername
    anotherusername:
    Anyway, it doesn't use curly braces and the IF ... THEN ... END IF syntax is pretty indicative of VB. Also using ' for comments.

    But VB.NET has curly braces! https://msdn.microsoft.com/en-us/library/bb385125.aspx https://msdn.microsoft.com/en-us/library/dd293617.aspx

  • (disco) in reply to aliceif

    "It" meaning the code fragment from the article, which doesn't use curly braces at all.

    Anyway, I meant doesn't use curly braces to offset code blocks. So the code obviously was not C, Java, etc.

  • eric bloedow (unregistered)

    Support : I'm telling you, nothing changed!!! The only difference between the old version and the new version is that the old version was in COBOL, and the new one is in C!!! "did you make any changes to your system? NO! i got a new computer, but i didn't change anything!"

Leave a comment on “Classic WTF: Holiday Smorgasbord”

Log In or post as a guest

Replying to comment #:

« Return to Article