• (nodebb)

    TRWTF: "didn't migrate history"

  • TRWTF (unregistered)

    TRWTF, no frist post :O

  • Kaewberg (unregistered)

    TRWTF: "noprob". not never un-use non-negatives as non-parts of unboolean unvariables.

  • Sally Flynn (unregistered)

    "Exception eee"

    I feel that variable name is appropriate, as "eee" is the sound you make when you see this code.

  • Brian (unregistered) in reply to Kaewberg
    TRWTF: "noprob". not never un-use non-negatives as non-parts of unboolean unvariables.

    I don't dislike this rule of thumb.

  • Oliver Jones (google)

    WASPs? (white anglo-saxon protestants)

    Q. How many arrogant WASP engineers does it take to refactor silly code?

    A. (sneering) One.

  • Zenith (unregistered) in reply to Sally Flynn

    It's probably because this is in an event handler where .NET defaulted to e for the event arguments.

  • St.Grimes (unregistered)

    The “hack” is 50% necessary depending on your compiler settings and the part of the code that we do not see here. You might get a warning if you initialize variables within a code block but declare and use them on the outside. If you chose to "treat warnings as errors" then you are stuck at this point.

  • fun_with_the_herd (unregistered) in reply to Oliver Jones

    Web Application Security Protocol, you fool!

    Refactor it to your hearts content, Remy.

    Refactor Refactor Refactor

    PS: Don't be evil.

    What's evil? The absence of good.

    What's good? What we say is good, including spinning up clones in China, executing them in soccer stadiums, and then harvesting their organs.

    I bet facebook could do it now just on phrenology alone.

    Hey, why not? Great pay day!


    PS PS: Adsense sucks. Want a universal wage? Pay your publishers!

    Some light reading for this Easter Sunday, folks!



  • fun_with_the_herd (unregistered)


    Wrong link!

    Sorry, for real!


    Keep it up bitly and outlook. My patience is great and my memory is long.

  • fun_with_the_herd (unregistered)

    PS PS:

    You can "phase" the hubble in accordance to the natural frequency of EM emissions of Planet Earth to see well into the past.

    Don't worry about signaling aliens, just dump it off on AC, and make them the fall guy!

    Brew up a big pitcher of ice tea, and watch the fireworks begin!

  • (nodebb)

    What I want to know is why does it create two WASPApplicationServer() instances, throwing the first one in the bitbucket immediately after creation?

  • Wilson (unregistered) in reply to CoyneTheDup

    Why, that's the hack to be able to compile of course.

  • Tekay37 (unregistered) in reply to CoyneTheDup

    Maybe mainserver was used within the catch block and the compiler didn't like that because the variable might not have been initialized.

  • RichP (unregistered)

    Stereotypical Jamacan programming? "noproblem mon"

  • (nodebb)

    To be fair, at least "throws the exception away" is not (obviously) true, as it does pass it to logger.error() first. Granted, this is damning with faint praise.

  • I Am A Robot (unregistered)

    It's the sort of hack we've all done in the past - the code looks good to you and everyone who looks at it but fails to compile, so you try more and more ridiculous things, then once it works you don't ever touch it.

  • Meant to add ... (unregistered)

    The real wtf is calling the flag noprob. It's a Boolean with wording that has a not in it. That causes so many problems. So the if check could be:

    if (!noProb) // not not problem

    Please people, always keep it simple:

    bolean success = true; Then if an exception is thrown, set it to false. Then: if (!success ) // not a problem

  • (nodebb) in reply to Sally Flynn

    "Exception eee"

    I've seen that sort of thing done by places that had an automatic code review system that rejected all variable names that were shorter than three characters. Of course, everyone then just does the lazy approach of typing a single letter three times, making the code longer but otherwise no better. (I've also seen code that went the other way; for (int the_innermost_loop_iteration_counter = 0; … isn't something you want either.)

  • trailmax trailmax (google)

    The TDWTF is migrating to SVN in 2011.

  • Rando dude (unregistered)

    True story: I work with developers who like to wrap their entire program in a try except clause, and in the except clause simply print "this is broken" and never raise the error again.

  • markm (unregistered)

    I think that, as St Grimes suggested, the "hack" was needed because a variable defined only in a code block isn't visible outside of that code block. To make it visible throughout the module, it had to be defined before the first code block. But I'm either not familiar with the language used, or the programmer missed the obvious...

    1. Could "mainserver" have been defined (giving the name and perhaps the type) first without initializing it, or by initializing it to a null-filled structure so there was no possibility of a failure? That's what I would do in any flavor of c/c++/c#, even if I had to make it "void *mainserver;".

    2. If the variable definition cannot be separated from calling the initialization function (which may depend on external conditions), the TRWTF is a language that includes try-catch blocks but does not allow the first definition/initialization operation to be in a try block.

    Given both of these conditions (and it seems more likely that the programmer just didn't know how to properly use the language), the hack is a sort-of-reasonable work-around: define & attempt to initialize the variable first, ignoring failures, and then immediately re-do the initialization with failures being caught.

  • Jaloopa (unregistered) in reply to trailmax trailmax

    I agree. They should have been on it much earlier but at least they're on the best system now

Leave a comment on “Attack of the WASPs”

Log In or post as a guest

Replying to comment #:

« Return to Article