• (cs) in reply to
    :
    Whut? Speak up son, we can't hear you!


    Holy crap, now that I've calmed down from a 3 minute LMAO [:D], I don't think I'll be allowed to read the Daily WTF at work any more.  [:'(]
  • (cs)

    The part I don't understand is why it makes extra trips to the database. I'd expect at an absolute minimum that it would be cached so that there's only two lookups, and potentially pulled into a dataset and worked with offline if working with multiple tables/sets.

  • (cs) in reply to bjmarte
    bjmarte:

    [image] Mike R wrote:


    As has been pointed out by a multitude of the people that post on this board it creates 4 round trips to the database to read 2 values. How, exactly is that efficient?

    I'd just like to point out here that the two values he is reading are from the same table and from the logic of the code (what logic there is anyway) it seems that these two values could be read from the same row.  Which means he could have done all the necessary data access in a single call rather than four.  WTF2.

    The fact that the values he reads COULD all be from different rows if someone else updates the table in the time between the multiple queries is another WTF.

  • (cs) in reply to

    Ah, yes, of course, I should have noticed. Sorry about that.

  • (cs) in reply to
    :
    As usual, all the comments posted here are the biggest WTFs.
    So true [:D]
    :
    There is nothing wrong with this code.  It works, it is efficient, it is easy to read, what else can you ask for?
    Now this is where you get it wrong [:)] This guy executes the same SQL statement 3 times, extracting 2 times the same field, and one time another. Efficient? Right... Sure it'll work. Clean? Hell no! For starters, it's VB, and it even demonstrates some of the VB nightmares... A teachbook example of how it should not be done :)
  • (cs) in reply to
    Anonymous:
    ... overloaded in VB.Net ...

    Wait.  Hold on.  Are you saying that in VB6, you can't actually say "Return VarName" and have it return the variable/value stored in VarName?

    To me, that's more of a WTF than anything I've seen so far from this site. 


    In this case, u have to do:

    FunctionName = returnVal
    exit function

    VB6 sucks :)
  • ropata (unregistered)

    I think you guys are missing the wood for the trees. TRWTF is that the function edits its own comment block, but that comment is self-contradictory

        '      No software updates have been applied.
    '      On 8 March at 8:00am you processed update 4. 

  • Dan (unregistered) in reply to ropata

    Um no. I think that is an example of output in the comments - not very clear, though.

Leave a comment on “Where's WTF?”

Log In or post as a guest

Replying to comment #:

« Return to Article