• (cs) in reply to clickey McClicker
    clickey McClicker:
    ...rip off their shirts, put on Hockey uniforms which leads to games and fighting/smashing/clobbering/pummelling.
    Band on the run, eh?
  • (cs) in reply to clickey McClicker
    clickey McClicker:
    KattMan:
    If you choose not to decide, you still have made a choice. Rush
    That isn't dumb or redundant. That is deep and full of underlying truth.
    Interestingly, if you read the lyrics in the CD liner, you'll find that at first the line was, "If you choose not to decide, you cannot have made a choice." Evidently they decided their listeners were by and large too dense to pick up on the tongue-in-cheekiness of that line, so they changed it to make it an instructional rather than wry observation.
    clickey McClicker:
    Like my brother-in-law who quit Wal-mart so he could play games, a lot of people should hear that quote. Inaction is often worse than 'the wrong' action. His inaction is really a choice of shocking stupidity.
    Your sister married a guy who worked at Walmart?
  • (cs) in reply to clickey McClicker
    clickey McClicker:
    KattMan:
    If you choose not to decide, you still have made a choice. Rush

    That isn't dumb or redundant. That is deep and full of underlying truth.

    Like my brother-in-law who quit Wal-mart so he could play games, a lot of people should hear that quote. Inaction is often worse than 'the wrong' action. His inaction is really a choice of shocking stupidity.

    I found this similar to the Smashing Pumpkin's reference "what I choose is my choice" as a previous poster said, as long as it doesn't reference the same decision, I don't see the problem, it is does, then it is a tautology. This is not to say that some tautologies do seem to make sense when you think about them.

  • (cs) in reply to Code Dependent
    Code Dependent:
    clickey McClicker:
    Like my brother-in-law who quit Wal-mart so he could play games, a lot of people should hear that quote. Inaction is often worse than 'the wrong' action. His inaction is really a choice of shocking stupidity.
    Your sister married a guy who worked at Walmart?
    Or he married a girl whos brother worked at Wal*mart; thereby, willingly inheriting said brother-in-law.
  • adiscordiansayswhat? (unregistered) in reply to Code Dependent
    Code Dependent:
    clickey McClicker:
    KattMan:
    If you choose not to decide, you still have made a choice. Rush
    That isn't dumb or redundant. That is deep and full of underlying truth.
    Interestingly, if you read the lyrics in the CD liner, you'll find that at first the line was, "If you choose not to decide, you cannot have made a choice." Evidently they decided their listeners were by and large too dense to pick up on the tongue-in-cheekiness of that line, so they changed it to make it an instructional rather than wry observation.

    "I will choose free will."

    If you have free will, you have free will and there is no choice to be made.

    If you do not have free will, you will have no choice but to have chosen it.

    Either way it is irrelevant.

  • (cs) in reply to adiscordiansayswhat?
    adiscordiansayswhat?:
    "I will choose free will."

    If you have free will, you have free will and there is no choice to be made.

    If you do not have free will, you will have no choice but to have chosen it.

    Either way it is irrelevant.

    Uh... I'm just going to let this one slide on by... I'm too busy for this kind of silliness.

  • adiscordiansayswhat? (unregistered) in reply to Code Dependent

    ]Uh... I'm just going to let this one slide on by... I'm too busy for this kind of silliness.[/quote]

    Aww. :(

  • (cs) in reply to durnurd
    durnurd:
    or perhaps
    void Lib::output(Lib* self)
    {
        STATUS = self->active;
    }

    That's better, but I still prefer my coworker's approach to code like this:

    Ctrl-A

  • (cs) in reply to Matt.C
    Matt.C:
    ANDY GOTH=NO

    IFSWEET=CANDY=NOTHGOEND

  • TimmyT (unregistered) in reply to puzzled
    puzzled:
    Zero:
    I thought the lyric was "...world in which we're livin'". Which makes more sense.

    it's

    But if this ever changin' world In which we live in Makes you give in and cry

    Say live and let die

    I always thought it was:

    But if there's one thing in this world that I like better Than a corned beef on rye It's Chicken Pot Pie

  • (cs)
    Consider Andy Goth's submission. After successfully integrating a flight simulator with an image generator and making it a sparkling gem of efficiency, maintainability, and clear documentation, he was given the task of documenting the high-level architecture and low-level implementation of which the following code is a part of.
    No way, Andy is the author of Excel 97?!
  • blunder (unregistered) in reply to dtech
    dtech:
    Consider Andy Goth's submission. After successfully integrating a flight simulator with an image generator and making it a sparkling gem of efficiency, maintainability, and clear documentation, he was given the task of documenting the high-level architecture and low-level implementation of which the following code is a part of.
    No way, Andy is the author of Excel 97?!

    ^ Blue, now!

  • pglewis (unregistered) in reply to Code Dependent
    Code Dependent:
    Try this: "But if this ever-changing world in which we're living makes you give in and cry--Say 'Live and let die'."

    Wow... all these years I'd heard it as:

    "We peaked with Uncle Albert / Admiral Halsey, sorry to put you through this Bond theme tripe"

  • (cs) in reply to pglewis
    pglewis:
    "We peaked with Uncle Albert / Admiral Halsey, sorry to put you through this Bond theme tripe"
    Yes, there's a certain subliminal deliciousness about, "The butter wouldn't melt, so I put it in the pie."
  • clickey McClicker (unregistered) in reply to KattMan
    KattMan:
    Code Dependent:
    clickey McClicker:
    Like my brother-in-law who quit Wal-mart so he could play games, a lot of people should hear that quote. Inaction is often worse than 'the wrong' action. His inaction is really a choice of shocking stupidity.
    Your sister married a guy who worked at Walmart?
    Or he married a girl whos brother worked at Wal*mart; thereby, willingly inheriting said brother-in-law.
    For clarity: My wifes brother worked at wal mart, he was about twelve when we married and now has a black sheep aura about him. <insert obligatory parenting lecture> For reference: My sisters husband is an architech.
  • clickey McClicker (unregistered) in reply to TimmyT
    TimmyT:
    I always thought it was:

    But if there's one thing in this world that I like better Than a corned beef on rye It's Chicken Pot Pie

    I confuse Weird Al for the originals too. But that is OK, parodies can be better sometimes.

  • Ass Blanket (unregistered) in reply to clickey McClicker
    clickey McClicker:
    For clarity: My wifes brother worked at wal mart, he was about twelve when we married and now has a black sheep aura about him. <insert obligatory parenting lecture> For reference: My sisters husband is an architech.

    For clarity: Use apostrophes. For Example: My sister's husband is an architect.

  • (cs)
    api->setCallback(&callback, (void*)this);

    Yet another place for boost! Now 100% more generic with boost::function< void(void) >!

    api->setCallback( boost::bind(&Lib::callback, (void*)this) );
  • bob (unregistered) in reply to KattMan
    KattMan:
    Code Dependent:
    dcardani:
    Doc Monster:
    Code Dependent:
    Not as bad as David Lee Roth singing

    I don't believe you It must be true No one could look as good as you

    Even worse is Sammy Hagar singing

    Only time will tell If our love Will stand the Test of Time

    (--Van Halen, Why Can't This Be Love?)

    Sammy needs to read the dictionary page for "tautology".

    Or Smashing Pumpkins' "what I choose is my choice." Brilliant.

    Here ya go (reaching way back)--Bob Wills' "Cherokee Maiden":

    One night when the moon was bright on a moonlit glade

    If you choose not to decide, you still have made a choice. Rush

    who said tautologies can't have meaning

  • (cs) in reply to bob
    bob:
    who said tautologies can't have meaning
    The truth value of a tautology or contradiction depends entirely on its linguistic structure. Therefore one does not make any claim about the circumstances outside of language when one holds that a tautology is true or a contradiction is false.
  • Bob (unregistered) in reply to adiscordiansayswhat?
    adiscordiansayswhat?:
    "I will choose free will."
    I choose to believe what I am predestined to believe!
  • (cs) in reply to Bob
    Bob:
    adiscordiansayswhat?:
    "I will choose free will."
    I choose to believe what I am predestined to believe!
    A host of holy horrors to direct our aimless dance.
  • methinks (unregistered) in reply to cellocgw
    cellocgw:
    I thought it was "If this ever-changing world in which we're living.." At least one online lyrics source agrees with me:

    http://www.sing365.com/music/lyric.nsf/Live-And-Let-Die-lyrics-Paul-McCartney/8479C51B2F85A57748256A4C0008CAE9

    Yes and no... quoted from the link:

    1st stanza, 4th line: But If This Ever Changing World In Which We're Livin'

    3rd stanza, 3rd line: But If This Ever Changing World In Which We're Live In

    Note the difference at the end of the line!

    If this should really be correct (at least if you replace "WE'RE live in" by "WE live in" in the 3rd stanza), it'd also apply to some post higher up: The cited Axl Rose "mistake" would not be one anymore then ;o)

  • dag (unregistered) in reply to bob
    bob:
    EFH:
    I'm surprised noone has mentioned "self" up until now. C++ doesn't have "self", it has "this". There must be a macro someplace

    #define self this

    Clearly this programmer didn't feel at home with C++.

    look again, 'this' is used with the instance methods, the 'self' pointer was passed in to the static methods to make the pseudo-instance methods.

    That's actually a common trick in C++ to implement C callbacks (or thread functions): you define a static function that takes a void* that is the pointer to your object.

    class C { static void updateCB(void* vp) { C* self = (C*) vp; self->update(); } };

  • (cs) in reply to Ass Blanket
    Ass Blanket:
    clickey McClicker:
    For clarity: My wifes brother worked at wal mart, he was about twelve when we married and now has a black sheep aura about him. <insert obligatory parenting lecture> For reference: My sisters husband is an architech.

    For clarity: Use apostrophes. For Example: My sister's husband is an architect.

    Yeah, in general you are right; apostrophes can add clarity. But your specific example doesn't really help. How is "My sisters husband is an architect" less clear than "My sister's husband is an architect?"

    Did you get confused in reading this short sentence, thinking all of his sisters were achitects, and couldn't figure out what a husband had to do with it?

    One of the nice things about language is it generally carries redundant information. The point of the redundancy is to help with the context, when people make a mistake.

  • Stan the Man (unregistered) in reply to Andrew

    The Beatles were alright. But Wings - now that's a band.

  • (cs) in reply to blunder
    blunder:
    dtech:
    Consider Andy Goth's submission. After successfully integrating a flight simulator with an image generator and making it a sparkling gem of efficiency, maintainability, and clear documentation, he was given the task of documenting the high-level architecture and low-level implementation of which the following code is a part of.
    No way, Andy is the author of Excel 97?!

    ^ Blue, now!

    Seconded.

  • Peter (unregistered) in reply to Ass Blanket

    C 1995 I read a superb WTF article by a chimney sweep who was working in a formerly large house now converted to flats. The chimney was blocked near the top - often the sign of a bird's nest but he could not shift it. After getting access to the patio of the top flat he finds that the chimney has been altered and blocked - making exactly the danger of CO that the downstaies customer was keen to avoid.

    Woman of top flat says "Do you like our barbecue? My husband made it. he's an architect.".

  • Harleqin (unregistered) in reply to chrismcb
    One of the nice things about language is it generally carries redundant information. The point of the redundancy is to help with the context, when people make a mistake.

    Yes, but it is still a mistake. Correcting all the small mistakes in what I read doesn't take up much "brain processing" per mistake, but it adds up, and slows the reading process, making it less pleasant to read what you are writing.

    So, "my sister's brother" gets parsed without problem. "my sisters brother" throws an exception, because "sisters" is the plural, and a noun after that makes no sense. The stack gets unwound to before "sisters", "sisters" is replaced by "sister's" to comply with having another noun ("brother") afterwards, finally reading is resumed. Yes, this is fast. No, it is still not pleasant.

    It is like this WTF example. It may work somehow, but it is not correct.

  • drobnox (unregistered) in reply to puzzled

    What do you call a dog with wings?

    Linda McCartney

  • Watson (unregistered) in reply to clickey McClicker
    clickey McClicker:
    My wifes brother worked at wal mart, he was about twelve when we married
    You married your wife's brother?

    Oh, "When I married my wife, her brother was about twelve and worked at wal mart...."

  • Bill Waite (unregistered) in reply to chrismcb
    chrismcb:
    How is "My sisters husband is an architect" less clear than "My sister's husband is an architect?"

    As a fundamentalist Mormon, I was totally confused by that sentence. I thought he was saying "My sisters' husband is an architect."

    (For reference, MY sisters' husband is a church elder.)

  • Watson (unregistered) in reply to Queex
    Queex:
    If you choose not to decide, you still have made a choice. Rush

    I think that still makes sense, as long as 'choose' and 'decide' don't reference the same Decision object. If presented with the Decision 'You are either with us or against us' you could choose neither option (presumably by raising a FalseDichotomyException) and still have made a choice (i.e. compile without errors).

    See, now why can't other people explain things in terms I understand?

  • PseudoNoise (unregistered)

    Too bad there are so many side-comments in this thread, because the WTF is a doozy.

    I'm trying to count them:

    • classes with public members
    • default ctor AND "initialize ()", instead of RAII
    • singleton-ish sorta behavior but not really .. ?
    • static callback is understandable, but why are the other methods static? update is called from a context that knows it's a Lib, all the calls within update should be non-static.
    • using globals in OTHER translation units, kidnapping them through extern calls rather than #including the public header for those units. How do you know you got the right DATA? or STATUS? Pure evil right there.
    • STATUS is supposed to copy state of active, but only on output() ... ?
    • can a brother get a delete? dtor anybody?
    • Whoa, the static callback method actually has a static Lib* in it!

    So by my count, 3 persistent Lib*:

    • the file-scope "lib". Probably not static because some OTHER file will pull it in with "extern Lib* lib" to muck with it.
    • the function-scope "self" in the callback, which is assigned to the passed-in value and then overwrites the file-scope "lib" above. Why is this static if it just passes through the input value to the global? Presumably the caller in API::transmit can set this to NULL for ... I dunno why, but the update loop expects that.
    • the function-scope "myLib" in the main loop.

    Also there's a static Obj1::data that I think should have been defined at file scope, unless somehow it's defined in another translation unit (why the hell not? Except Obj1 isn't defined till here).

    Anyway, my mind is turning in on itself. This is truly horrific. Thanks and pity upon the submitter.

  • (cs) in reply to Watson
    Watson:
    clickey McClicker:
    My wifes brother worked at wal mart, he was about twelve when we married
    You married your wife's brother?

    Oh, "When I married my wife, her brother was about twelve and worked at wal mart...."

    You can't marry your wife, even in a polygamous society. Also, I don't think Walmart employ 12-year-olds.
  • (cs)

    Wings: 'They’re only the band the Beatles could have been.'

    I once worked with a goth called Andy at a games company. What are the chances of that!

    Skizz

  • Bond... James Bond (unregistered) in reply to Mel
    Mel:
    ThomsonsPier:
    "of which the following code is a part of"?
    Sure - it's from the "Live and let die" school of grammar:
    The Beatles:
    But in this ever changing world in which we live in

    It's called artistic license to kill

  • (cs)

    Talking of song lyrics, the other day I heard on the Radio the "blue jeans" song http://www.youtube.com/watch?v=iBxjVgogq0w

    Heard it several times before and always thought the bit "The Reverend Blue Jeans" was a bit of a strange lyric to have...

    I only realised last week he's actually singing "Forever in Blue Jeans"...

    :)

  • Pony Princess (unregistered)

    tl;dr

  • Mr. Twisted (unregistered) in reply to pjt33
    pjt33:
    Watson:
    clickey McClicker:
    My wifes brother worked at wal mart, he was about twelve when we married
    You married your wife's brother?

    Oh, "When I married my wife, her brother was about twelve and worked at wal mart...."

    You can't marry your wife, even in a polygamous society. Also, I don't think Walmart employ 12-year-olds.
    How about, "My wife's brother, who used to work at Walmart, and is now 20 years old by the way, was only 12, when, eight years ago, I married the woman, who was formerly single, but is now my wife."
  • AdT (unregistered) in reply to chrismcb
    chrismcb:
    Yeah, in general you are right; apostrophes can add clarity. But your specific example doesn't really help.

    Flogging a dead horse...

    Yes, it does. First, its annoying if you half two do allot of begdragging to understand the meaning of a sentence. :-) And yes, as was already mentioned, this makes it harder and less pleasant for people to understand someone without adding any benefit.

    Second, it leaves people wondering whether the writer made additional mistakes, or a sentence may be ambiguous even under the assumption that a single mistake was made. My sisters stepson flowers.

    Don't get me wrong. Mistakes happen. But defending mistakes is pointless.

  • Tatar (unregistered)

    This might be not as stupid as it may look like. Symbian OS is full of static methods, two-phased constructors, and wrapper classes around even more deeper wrappers. And there are plenty of good reasons for all of that stuff.

    For example: this is a Symbian-way to create an instance of CMyClass object

    static CMyClass * CMyClass::NewLC(MWrapper * aWrapper)
    {
        CMyClass * self = new (ELeave) CMyClass(); // do nothing in constructor
        CleanupStack::PushL(self);
        self->ConstructL(aWrapper); // all constructor  goes here
        return self
    }
    

    Quite a nitpicking

  • Pyroka (unregistered) in reply to Claxon
    Claxon:
    ... marathon video game playing sessions...

    Yup, that sounds about right to me! An office that doesn't even have a single arcade machine isn't worth going to every day!

    Not to mention a fridge stocked with beer.

  • Orbstart (unregistered) in reply to Bond... James Bond
    Bond... James Bond:
    Mel:
    ThomsonsPier:
    "of which the following code is a part of"?
    Sure - it's from the "Live and let die" school of grammar:
    The Beatles:
    But in this ever changing world in which we live in

    It's called artistic license to kill

    What a bad joke, never say never again ok?!

  • j (unregistered) in reply to AdT
    AdT:
    chrismcb:
    Yeah, in general you are right; apostrophes can add clarity. But your specific example doesn't really help.

    Flogging a dead horse...

    Yes, it does. First, its annoying if you half two do allot of begdragging to understand the meaning of a sentence. :-) And yes, as was already mentioned, this makes it harder and less pleasant for people to understand someone without adding any benefit.

    Second, it leaves people wondering whether the writer made additional mistakes, or a sentence may be ambiguous even under the assumption that a single mistake was made. My sisters stepson flowers.

    Don't get me wrong. Mistakes happen. But defending mistakes is pointless.

    Yea, because going on about how someone made a mistake isn't pointless. Who gives a ...

  • monkay (unregistered)

    This is not only one bad practice after the other. The guy seems to have some pretty obvious brain deficiencies.

  • (cs) in reply to Quango
    Quango:
    "The Reverend Blue Jeans" was a bit of a strange lyric to have... :)
    How about that Creedence tune, "There's a Bathroom on the Right"?
  • Thorarin (unregistered) in reply to puzzled
    puzzled:
    static bool first = true; if (first) { first = false;
    That is one of the few things that actually made some sense. You might want to learn about a language before commenting...
  • anonymous (unregistered) in reply to Thierry Henry

    "When the moon hits your eye like a big pizza pie, that's Traore..."

    (with apologies to Dean Martin)

    Captcha: ideo (thinking in Italian)

  • puzzled (unregistered) in reply to Thorarin
    Thorarin:
    puzzled:
    static bool first = true; if (first) { first = false;
    That is one of the few things that actually made some sense. You might want to learn about a language before commenting...

    i'll say it again the comment was in reply to the "FIRST" comment

Leave a comment on “self->Static Anti-Pattern”

Log In or post as a guest

Replying to comment #:

« Return to Article