• Anonymous (unregistered)

    Fist!

  • Anonymous (unregistered)

    Secodn!

  • anoncow (unregistered)

    Turd!

  • Fiona (unregistered)

    Thrd!

  • Fiona (unregistered)

    HUUUUUUUUURF

  • (cs)
    If .Fields("CUST_NUM") = "7742" Then dtmOrderPlaced = dtmOrderPlaced End If
    looks to me like someone needed a breakpoint while debuggering
  • (cs)

    25th! (space)

    No, I didn't count. Had the computer do it for me.

    WTF?

  • (cs) in reply to A Nonny Mouse
    A Nonny Mouse:
    If .Fields("CUST_NUM") = "7742" Then dtmOrderPlaced = dtmOrderPlaced End If
    looks to me like someone needed a breakpoint while debuggering

    looks to me like someone had no clue what he was doing!!!

  • (cs) in reply to jimlangrunner
    jimlangrunner:
    25th! (space)

    No, I didn't count. Had the computer do it for me.

    WTF?

    "twenty" is obviously base 12.5

  • (cs)
    alex:
    #define false 1
    #define true 0 
    Brought to you by the same folks who came up with FileNotFound?
  • (cs) in reply to Jithu2k1
    Jithu2k1:
    A Nonny Mouse:
    If .Fields("CUST_NUM") = "7742" Then dtmOrderPlaced = dtmOrderPlaced End If
    looks to me like someone needed a breakpoint while debuggering

    looks to me like someone had no clue what he was doing!!!

    Bah. for breakpoints, i=i has always struck me as easy. but then, so am I.

  • Customer Service (unregistered)

    Customer requirement one: The date must appear in columns 1 thru 10.

    Customer requirement two: The product description (45 characters) must be right justified to column 80.

    Customer requirement three: There must be twenty spaces between the date and the product description.

    Solution:

    private final static String twentyspaces = "                         ";

    The customer is always right!

  • some coder (unregistered)
    I found this in some production code:

    int iChkShut; // variables MUST be initialized, not sure whyFunny enough, the parameter iChkShut is used (uninitialized) for comparisment a couple of rows later.

    Holy bejesus that's funny

  • Stephen Bayer (unregistered) in reply to A Nonny Mouse
    A Nonny Mouse:
    jimlangrunner:
    25th! (space)

    No, I didn't count. Had the computer do it for me.

    WTF?

    "twenty" is obviously base 12.5

    I was under the impression that bases needed to be whole numbers over 1.. ie. base 2, base 3, base 4, base 5, ... ok.. this could go on for a while.. i think there are a lot more whole numbers over 1. I used to use random bases when doing my fourth grade math homework, then argue with the teacher about the validity of my answers, calling her an idiot for not agreeing with me that 8 + 5 = 11

  • andem (unregistered)
    if((0 == DblSpread) || (0 == DblSpread))

    This comparison order is actually an old trick to avoid unintentional assignment in if() clause from the days when IDEs/compilers didn't warn about those. Constant = Variable assignment resulted in compiler error and saved some debugging time.

  • (cs) in reply to Stephen Bayer
    I was under the impression that bases needed to be whole numbers over 1.. ie. base 2, base 3, base 4, base 5, ... ok.. this could go on for a while.. i think there are a lot more whole numbers over 1. I used to use random bases when doing my fourth grade math homework, then argue with the teacher about the validity of my answers, calling her an idiot for not agreeing with me that 8 + 5 = 11

    Okay, thanks for sharing with us what a base is... The point of the joke is that the twentyspaces variable is actually 25 spaces. 20 in "base 12.15" here is equal to 25 base 10.

    If anything, you're the idiot for assuming base 12 on a fourth-grade level problem.

  • NiceWTF (unregistered) in reply to snoofle
    snoofle:
    alex:
    #define false 1
    #define true 0 
    Brought to you by the same folks who came up with FileNotFound?

    Brought to you by strcmp() and friends, more likely.

  • Mark! (unregistered)
    lSend = IIf(lSend = True, True, False)

    As far is I know VB6, lSend doesn't have to be a boolean, ie it can be a Variant. So it could contain other values then true or false. For example, null when read from a db.

    This is an ok trick to get a true/false only (boolean)

  • Dan (unregistered)

    if(isGoodComment || !isGoodComment) { postComment(); }

  • (cs) in reply to Stephen Bayer
    Stephen Bayer:
    I was under the impression that bases needed to be whole numbers over 1.

    I was under the impression that everyone who reads here has at least enough intelligence and sense of humor to recognize a joke and therefore not feel the need to correct it. Apparently, I was wrong.

    Thanks for correcting my misunderstanding.

  • (cs) in reply to andem
    andem:
    if((0 == DblSpread) || (0 == DblSpread))

    This comparison order is actually an old trick to avoid unintentional assignment in if() clause from the days when IDEs/compilers didn't warn about those. Constant = Variable assignment resulted in compiler error and saved some debugging time.

    Wow. You'd be really smart if:

    a) You didn't state the obvious.

    b) You realized that the actual WTF wasn't the constant/variable order, but the fact that the same identical comparison was made twice using an OR.

    Thanks for playing, though.

  • (cs)
    alex:
    #define false 1
    #define true 0
    #define ZERO -1
    Remember that? I took a second look at the code, and it turns out I was wrong. Here's how it actually reads:
    #define NEGATIVE_ONE 0
  • Niels (unregistered)
        lSend = IIf(lSend = True, True, False)

    Obviously because there are other values than True and False. (FileNotFound etc.)

    In a real language I'd just have done lSend = !!lSend; for it, concise way to force a value to boolean.

  • (cs) in reply to A Nonny Mouse
    A Nonny Mouse:
    If .Fields("CUST_NUM") = "7742" Then dtmOrderPlaced = dtmOrderPlaced End If
    looks to me like someone needed a breakpoint while debuggering
    A conditional breakpoint, in a debugger that doesn't support them.
  • (cs) in reply to andem
    andem:
    if((0 == DblSpread) || (0 == DblSpread))

    This comparison order is actually an old trick to avoid unintentional assignment in if() clause from the days when IDEs/compilers didn't warn about those. Constant = Variable assignment resulted in compiler error and saved some debugging time.

    That's not the wtf, the wtf is that it's exactly the same comparison twice.

  • (cs) in reply to Anonymous
    If .Fields("CUST_NUM") = "7742" Then dtmOrderPlaced = dtmOrderPlaced End If

    If you do a lot of batch processing, it's only a matter of time until you write one like this. You'll get an error about 3/4 way through a large dataset and want to step through the code to find it, and so you write a no-op snippet like that so you can set a break point when it reaches the record that's causing the problem. But that could should never make it to production.

  • --- (unregistered) in reply to Thief^
    Thief^:
    A Nonny Mouse:
    If .Fields("CUST_NUM") = "7742" Then dtmOrderPlaced = dtmOrderPlaced End If
    looks to me like someone needed a breakpoint while debuggering
    A conditional breakpoint, in a debugger that doesn't support them.

    Yeah I've done that. I think conditional breakpoints were there, but made everything run so slowly it was basically unusable (it was on a PS2 compiler I think).

  • n0t 1337 h4xx0r (unregistered)

    #define false 1 #define true 0

    I've seen such a construction hidden deep inside some header... There was a comment: "Happy debugging, d*ckhead!";

  • blah (unregistered)

    comparisment?

  • Steve Boyko (unregistered)

    If (Mid(CStr(cppObject.GetValue()), 1, 1) = "-") Then ...

    Silly old bear, the programmer should have used Left rather than Mid. Saves a few keystrokes. ;)

  • Hope that helps (unregistered) in reply to blah
    blah:
    comparisment?
    Comparisment is used to avoid embarrison.
  • J. Palmer (unregistered)

    It wasn't a bug after all...

  • (cs) in reply to Stephen Bayer
    Stephen Bayer:
    I was under the impression that bases needed to be whole numbers over 1.
    A number base (a.k.a. radix) does not need to be a whole number; that just makes it easier to work with. The Unix DC program (or at least the dc.sed version) supports fractional input and output radixes, via the 'i' and 'o' commands. Type 12.5;i;20;p; (replacing ; with newlines), and it'll print 25. Take the input number 20, expand it to 2*(12.5**1)+0*(12.5**0), and you get 25. If dc has a fractional output base, it's forced to spell out each "digit" as a decimal number, separating the "digits" with spaces. For example, 3.4;o;20;p; yields 1 1.6 3.0, since 1*(3.4**2)+1.6*(3.4**1)+3*(3.4**0) = 20.
  • (cs)

    Ah, someone beat me to it. Comparisment is a word now?

  • (cs) in reply to WhiskeyJack
    WhiskeyJack:
    Ah, someone beat me to it. Comparisment is a word now?

    And a perfectly cromulent one at that.

  • Somer Himpson (unregistered)

    if (connected || !connected) { return file_not_found; }

  • Hope that helps (unregistered) in reply to WhiskeyJack
    WhiskeyJack:
    Ah, someone beat me to it. Comparisment is a word now?
    http://www.comparisment.com/ is a registered domain, so the word must be in some dictionary somewhere!
  • diaphanein (unregistered)

    ** the following code is neither recyclable or reusable ** but rather highly radioactive toxic sludge ** liable to give you hemmorragic brain damage and anal leakage of the mouth

  • diaphanein (unregistered)

    ** the following code is neither recyclable or reusable ** but rather highly radioactive toxic sludge ** liable to give you hemmorragic brain damage and anal leakage of the mouth

  • diaphanein (unregistered)

    ** the following code is neither recyclable or reusable ** but rather highly radioactive toxic sludge ** liable to give you hemmorragic brain damage and anal leakage of the mouth

  • (cs) in reply to Hope that helps

    lol, web squatters.

  • (cs) in reply to Hope that helps

    Some of the conditional stuff I can see; you write it, you change it, you write it, you change it, you write it and FINALLY the data matches what it's supposed to and you don't recheck.

    The "20 spaces" I understand as well, though you should never ever ever do that. On old COBOL systems you have a lot of "Fixed Width" flat table databases, and huge chunks of spaces are actually really necessary for running through those, though I'm sure everyone here understands that you should never use more than 1 space at a time to avoid counting errors, and indeed, that more than 1 space isn't useful except in really ugly constructions like:

    $line = $valueA.twentySpaces.$valueC.$twentyTwospaces.$valueC;

  • Paul Carpenter (unregistered)
    #define false 1 #define true 0
    The source for the game Power Sports Soccer had something similar, along with

    #define BEGIN { #define END } #define FOR for #define IF if #define THEN { #define ELSE } else { #define ENDIF }

    There was an include file with about 30 more nuggets like that in it...

  • Kuba (unregistered) in reply to A Nonny Mouse
    A Nonny Mouse:
    If .Fields("CUST_NUM") = "7742" Then dtmOrderPlaced = dtmOrderPlaced End If
    looks to me like someone needed a breakpoint while debuggering
    That's why I have always been at loss why some standard C header is not forced to include something to the effect of
    #define NOP() asm("nop");
    I have a header in my library of "useful stuff" that does include this. It is quite cross-platform, too!

    Cheers, Kuba

  • Kevin (unregistered)

    The company that I work for has an internal application for product / stock management written in VBScript... And, as you can see here, they have great security.

    If  Len(Trim(fParentFrames2.sGetSecurityRights())) > 0 Then
    

    or

    '***  2004-06-17 - Jdepo -  Security
    iResults = 1
    

    They also have great version control, including inline changelogs!

    'Commented by NMURUG (Cognizant) to fix the defect# 842 on 25 Jul 2007 - Start Change
    'btnMyInfo.value = "My Info"
    'Commented by NMURUG (Cognizant) to fix the defect# 842 on 25 Jul 2007 - End Change
    
  • Ale (unregistered)
    if (connected || !connected) { //ED: Snip }
    He just doesn't want the code to run if connected = FileNotFound
  • rosko (unregistered) in reply to Mark!
    Mark!:
    lSend = IIf(lSend = True, True, False)
    As far is I know VB6, lSend doesn't have to be a boolean, ie it can be a Variant. So it could contain other values then true or false. For example, null when read from a db.

    This is an ok trick to get a true/false only (boolean)

    Or you could just use CBool(lSend)
  • HeavyBoy (unregistered)

    javascript:alert(" ".length);

  • moz (unregistered) in reply to Andy Goth
    Andy Goth:
    If dc has a fractional output base, it's forced to spell out each "digit" as a decimal number, separating the "digits" with spaces. For example, 3.4;o;20;p; yields 1 1.6 3.0, since 1*(3.4**2)+1.6*(3.4**1)+3*(3.4**0) = 20.
    I wonder why it chooses to print that "number", rather than 121.2.
  • Steve (unregistered)

    Regarding the final item, a number of years ago I had a discussion over a few Tsing Taos with some VMS weenies (er, hackers) about the proper values for true and false. Their contention was that since in VMS a return value of zero indicates success and any other value returned indicates failure of a function or operation, it makes sense that 1 (or any nonzero value) should be interpreted as false and only 0 be interpreted as true.

    They considered the C language's use of 0 as a false value to be a significant wart on the language.

    I can say that after many Tsing Taos and several servings of Kung Pao Death I was inclined to agree.

Leave a comment on “A Smorgasbord of Classics”

Log In or post as a guest

Replying to comment #:

« Return to Article