• hc (unregistered) in reply to Otto
    Otto:
    Whiskey Tango Foxtrot? Over.:

     "Yeah, um, we never actually find out what the ultimate question is in the book, that part where Arthur pulls letters out of a hat is just a joke. Arthur got it, you should too. Also, the correct quote is 'what do you get when you multiply six by nine'."

    Agreed. DNA expanded the joke to actually make more sense in the book version, where Ford notes that it's probably the wrong question, or a variation on the right one (before they pull out the letters). Having it turn out to be a variation on the wrong one was the humorous bit, which most people miss anyway.

    In the radio series it is much less clear, I grant you. The gag there is more along the lines of it indeed being the correct question, it simply turns out that the universe itself was wrong.

    The radio. Thanks god, for a moment I thought you were going to talk about the movie. *shudders*

  • Ripper the Non-Believer (unregistered) in reply to newfweiler

    Well, "resistance is useless" is correct, if you're quoting the cybermen of old, as in doctor who's tomb of the cybermen. which, by the by, is obviously the template for the Borg. another case of USA pop culture appropriating what the brits did first, and often better; file alongside Three's Company (aka "Man About the House") and so on.
     

  • Leif Arne Storset (unregistered) in reply to Proud To Be Junior
    Anonymous:

    The ultimate WTF method declaration we had at my last place from one of our Senior Software Developers was a method in java declared as:

     public List fetchSameButDifferent(List other);

     It occurs to me that it may fetch items that compare as equals but are different objects. Great method naming though.
     

  • Zygo (unregistered)
    Alex Papadimoulis:

    Good news, everyone: it's time for a new series! Technically, this is not the first time that I've presented a Representative Line: a single line of code from a large application that somehow manages to provide an almost endless insight into the pain that its maintainers face each day. However, going back and renaming the old articles is a bit of a hassle, so I'll just pretend this is the first episode.

    Today's Representative Line was uncovered by Hank Miller while he was "getting to know" a titanic system by fixing some of its bugs. This following function definition pretty much sums what the whole system is about ...

    bool return_true_24()

    For clarification, the "_24" suffix is not some bizarre homage to the author's favorite television show. It's ordinal; there are actually twenty-three other return_true functions in the system, each one doing something slightly different and, ironically, often returning false.

    It could be a symbol versioning system, where the system has to support entry points defined years in the past with the same (or backward-compatible) semantics.

    This of course implies that it took 24 tries (so far) to come up with a function that returns "true" when given no arguments. 

  • (cs) in reply to Zygo
    Anonymous:

    It could be a symbol versioning system, where the system has to support entry points defined years in the past with the same (or backward-compatible) semantics.

    This of course implies that it took 24 tries (so far) to come up with a function that returns "true" when given no arguments. 

    Oh, it's much, much worse than that.

    Let us assume that there are at least 23 other functions with the same name, but with the 24 suffix changed to other numbers.

    Let us also assume that at least one of these other functions does not accept arguments.

    Let us also assume that these functions are required.

    Therefore, the most likely explanation is that each function checks the states of various globally defined flags to determine which course of action should be undertaken based on those flags. They may also run other functions. For example, this function given today could check the state of three motors and start up the auxiliary fan on pump 14 in the cafeteria. This could explain why several of these functions return false. The cafeteria was bulldozed in 1978.

    In all these cases, the actual purpose of these functions is hidden from the programmer. It shows that they are using bad names, non-encapsulated writing styles, and a whole host of other WTFs. The code is a nightmare, a true blend of blasphemy and horror that would make a normal man weep. Understanding this code would be an effort for which Hercules himself would give you a pat on the back.

    And yes, I have seen this kind of crap before. My favorite is a pair of globally defined variables. They were defined as two bits in the int8 "FLAGS1" variable, and they were called "MISC1" and "MISC2".

  • Solo (unregistered)

    In most computer programming classes, they insist on telling you to name your variables in a clear fashion, and stick to the best desciption of what they contain. This is not QBASIC anymore, you're upgrading to real, professional grade languages, so do not use A, B, C as variable names, that's totally uncool.

    What they do not insist on, however, it that the student uses meaningful names for functions (or class members) because it is so extremely obvious and self implicating.

    I guess the average intelligence of base end programmers has been overestimated. 24 versions if return_true()? really...

    They call it the "mystery function" call it for a surprise().

    I feel for Hank though. 

    CAPTCHA: hotdog, and I don't know why.
     

  • bd (unregistered) in reply to dpm
    dpm:
    I call dibs on writing the  <font face="COURIER">return_true_42()</font> function.
    I call dibs on writing <font face="COURIER">return_true_25. It will return FILE_NOT_FOUND.
    </font>
  • rob_squared (unregistered) in reply to LordVetinari
    Anonymous:

    The WTF for me is the Symantec add in the RSS feed that says 'Enterprise security software that gets to threats before they get to you'.

    Two things:

    • Enterprise... Not a good word to use on this forum.
    • 'before they get to you'... are they talking about Symantec or the threats?

     

    wtFFtw 

    captcha: awesomeness

    Really?  My first thought was that Alex wasn't doing a good job of anonymizing if the Symantic logo is in the name, only to fid out its an ad. >:( 

  • (cs)
    Alex Papadimoulis:

    Good news, everyone: it's time for a new series! Technically, this is not the first time that I've presented a Representative Line: a single line of code from a large application that somehow manages to provide an almost endless insight into the pain that its maintainers face each day. However, going back and renaming the old articles is a bit of a hassle, so I'll just pretend this is the first episode.

    It does not matter.  It never ends.  Why should it end at the beginning?

    I was recently looking at some code at saw a line like:

    Dim intDescription as String

    "Description" is a placeholder for the name which I do not recall, but the rest of the line was as above.  Hungarian Notation rules.

    Sincerely,

    Gene Wirchenko

     

  • (cs) in reply to Ghost Ware Wizard
    Ghost Ware Wizard:

    <wtf/>

    what about:

    public int GetInt()

    {

    int  nValue  =

    <font size="+1">W</font>hat is this?  A Republic serial?  Adding a little bit each post--the suspense is killing me.
  • CynicalTyler (unregistered)

    It's clear that this is just an example of code obfuscation to throw off reverse engineering attempts.  It's just that they forgot where they put the de-obfuscator... yeah... that's it.

  • (cs) in reply to narrator

    Anonymous:

    The number 42 refers to The Answer to The Ultimate Question of Life, The Universe, and Everything from The Hitchhiker's Guide to the Galaxy by Douglas Adams. The ultimate question turned out to be 'what is six times nine', also from Adams' series.

    So... intentional, but not a WTF.

     Except the Earth was destroyed before final output could be achieved so there could have been operations left in the pipe to change that nine to a seven.

  • (cs) in reply to sf
    Anonymous:

    Autonuke:
    dpm:
    I call dibs on writing the  <font face="COURIER">return_true_42()</font> function.

    ok
    dpm


    :-)

    return (bool) ( return_true_6() * return_true_9() );

     I prefer:

    if ( (bool) ( return_true_6() * return_true_9() ) == TRUE)

         return TRUE;

    else

         return FALSE; 

     

    I prefer

    return (return_true_6() * return_true_9()) ? TRUE : FALSE;

     

    of course after defining in my "answer.h" file

    #define TRUE false

    #define FALSE true 

  • (cs)

    If the function doesn't always return true, he'd better rename it to:

     

    bool return_true_sometimes_and_false_otherwise_24() 

  • (cs) in reply to savar

    This is where my head exploded:

    savar:
    sqrt(false);


    But at least we now have a mathematical definition for half-truths: true*0.5, or was that false/2 ??

    Thank you very much.

  • Rich (unregistered) in reply to Ripper the Non-Believer
    Anonymous:

    Well, "resistance is useless" is correct, if you're quoting the cybermen of old, as in doctor who's tomb of the cybermen. which, by the by, is obviously the template for the Borg. another case of USA pop culture appropriating what the brits did first, and often better; file alongside Three's Company (aka "Man About the House") and so on.
     

     

    "Resistance is Futile"

       The Master, "The Deadly Assassin", Dr Who

     

    So even the actual phrase itself was used first on Who :)

     

    Rich
     

  • (cs) in reply to Anonymous
    Anonymous:

    newfweiler:
     

    I whole-heartedly agree with you.  How do I sign up for your newsletter? 

    Send me $0.00 in cash in an empty envelope.

  • Anonymous (unregistered) in reply to newfweiler
    newfweiler:
    Anonymous:

    newfweiler:
     

    I whole-heartedly agree with you.  How do I sign up for your newsletter? 

    Send me $0.00 in cash in an empty envelope.

    Hopefully that is in USD; I don't have any other currency, except a few pesos lying about.  Heck, I'll throw those in for good measure (these are the old Mexican pesos, so they are about 1/1000th of a new peso).

    Anyway, I put my money in the empty envelope, placed it on a wooden table, took a picture, scanned it into the computer, printed it out, made a copy, folded it 7.5 times and faxed it to you.  When should I expect my first newsletter?

  • Michael (unregistered) in reply to Proud To Be Junior
    Anonymous:

    The ultimate WTF method declaration we had at my last place from one of our Senior Software Developers was a method in java declared as:

     public List fetchSameButDifferent(List other);

     

    I can't remember what it did (or tried to do), but I will never forget that name...

     

     

    public List fetchSameButDifferent(List other) {

        return other.clone();

  • Cody (unregistered) in reply to narrator
    Anonymous:

    The number 42 refers to The Answer to The Ultimate Question of Life, The Universe, and Everything from The Hitchhiker's Guide to the Galaxy by Douglas Adams. The ultimate question turned out to be 'what is six times nine', also from Adams' series.

    So... intentional, but not a WTF.
     

    Turned out to possibly be "What do you get if you multiply six by nine?"   In fact, that is probably not the actual answer since it was the answer retrieved through Arthur Dent's interaction, which may have spoiled results, who happened to be a Golgafrinchen descendent, which may have spoiled results, with the humans after the Golgafrinchen landing, which may have spoiled results, before completion of the program anyway, which may have spoiled results.

  • Cody (unregistered) in reply to Zap
    Anonymous:
    Anonymous:

    Autonuke:
    dpm:
    I call dibs on writing the  <font face="COURIER">return_true_42()</font> function.

    ok
    dpm


    :-)

    return (bool) ( return_true_6() * return_true_9() );

    Perhaps you meant return_true_6() * return_true_<font size="+1">7</font>(), or was that an intentional wtf?

     

    6*9 = 42 if you use a tridecimal system.

     

    or if you:

    #DEFINE SIX = 1 + 5

    #DEFINE NINE = 8 + 1

    and take SIX * NINE (yanked from Wiki, of course)

  • Dear Lord (unregistered) in reply to sinistral

    sinistral:
    No doubt return_true_24() not only returns true, it aborts if it thinks that you're a terrorist seeking to take control of the US government.

    Wouldn't you want to Try and Catch(TerroristException te) and then return("bomb") to sender?

  • Dear Lord (unregistered) in reply to JL
    Anonymous:

    Alex Papadimoulis:
    There are actually twenty-three other return_true functions in the system, each one doing something slightly different and, ironically, often returning false.

    I'd be fascinated to see some examples -- ideally, three or more.  Given the function's only purpose is to return a boolean value, I wonder what "slightly different" actions it could be performing...  Some nasty side-effects, perhaps?  Or maybe the code contains "#define bool int"?

    <Guess>I think this enterprisey system has developers that aren't allowed to modify (or reuse) existing functions due to management direction, no documentation, no knowledge passed on, no time to find out how it works.  So they simply create a new "return_true" function that doesn't require any full regression test of the entire system.</Guess>

  • Anonononymous (unregistered) in reply to emurphy
    emurphy:

    "I may be a pretty sad person, but I don't make jokes in base 13."

    --Douglas Adams

     



    Which just makes it more funny, since he did it unintentionally.
  • (cs) in reply to Anonymous
    Anonymous:
    newfweiler:
    Anonymous:

    newfweiler:
     

    I whole-heartedly agree with you.  How do I sign up for your newsletter? 

    Send me $0.00 in cash in an empty envelope.

    Hopefully that is in USD; I don't have any other currency, except a few pesos lying about.  Heck, I'll throw those in for good measure (these are the old Mexican pesos, so they are about 1/1000th of a new peso).

    Anyway, I put my money in the empty envelope, placed it on a wooden table, took a picture, scanned it into the computer, printed it out, made a copy, folded it 7.5 times and faxed it to you.  When should I expect my first newsletter?

    It's in your printer right now!  Top page in the feed tray.

     

  • Anonymous (unregistered) in reply to newfweiler
    newfweiler:
    Anonymous:
    newfweiler:
    Anonymous:

    newfweiler:
     

    I whole-heartedly agree with you.  How do I sign up for your newsletter? 

    Send me $0.00 in cash in an empty envelope.

    Hopefully that is in USD; I don't have any other currency, except a few pesos lying about.  Heck, I'll throw those in for good measure (these are the old Mexican pesos, so they are about 1/1000th of a new peso).

    Anyway, I put my money in the empty envelope, placed it on a wooden table, took a picture, scanned it into the computer, printed it out, made a copy, folded it 7.5 times and faxed it to you.  When should I expect my first newsletter?

    It's in your printer right now!  Top page in the feed tray.

     

    Excellent insight into today's politics and views on governmental policy.  When will you be running for office? 

  • r3jjs (unregistered) in reply to newfweiler

    Of course you'd be chided.

     

    Everyone knows that resistance is (voltage/current). 

     

    captcha = captcha  Woot! 

  • Anonymous (unregistered) in reply to Jason

    Douglas Adams put it best himself...

     nobody writes jokes in base 13 [...] I may be a pretty sad person, but I don't make jokes in base 13.
     

  • (cs) in reply to Jason
    Anonymous:

    and oddly enough, 6 * 9 = 42 in base 13.

     

    Captcha: knowhutimean  No, I don't think I do.
     

    Again, from http://en.wikipedia.org/wiki/The_Answer_to_Life,_the_Universe,_and_Everything

    It was later pointed out by readers that 6 × 9 = 42 if the calculations are performed in base 13, not base 10. Douglas Adams later averred that he was not aware of this at the time, and repeatedly dismissed this as an irrelevant concoction, saying that "nobody writes jokes in base 13 [...] I may be a pretty sad person, but I don't make jokes in base 13."

  • (cs) in reply to Eam

    bool return_true_24()

    {

        return gIsTrue[ 23 ]; 

  • Hank Miller (unregistered) in reply to krizo

    I was going to give some reasonings, but EVERY replay (including the blank one) was more reasonable than what I think is going on.

    However I'm reasonablly sure that each of these 25 (there is a return_true with no number as well as 1-24) functions was hand coded.

  • Baston (unregistered) in reply to Autonuke

    erm .... i'd raher say return_true_6()*return_true_7()

    the one you gave is return_true_54 ;o)

  • cofw rkuveaxm (unregistered)

    sarucxm eohtywxf xdlk mwth gmzhkt lcxqdo hwfy

  • tbrown (unregistered) in reply to bgodot
    bgodot:
    newfweiler:
    Anonymous:
    >The *real* WTF is that this article has turned into nothing but a pedantic HHGTTG festival....agreed! lets have some *real* WTFs please!
    I once quoted "Resistance is useless!" and was chided "Resistance is FUTILE!  Get it right!".  Evidently I was in the middle of a pendantic something else festival.
     Resistance is Volts over Amperes.

    You will be buttimilated!

Leave a comment on “Representative Line: Tetricosanary Logic”

Log In or post as a guest

Replying to comment #:

« Return to Article