Simply Stu Your Goat, Right Away

Fun with Code…

Friday 9th November

Warning… geek stuff ahead…

Argh. Talk about obfuscation…

// Fire last known state
void fireLastKnownState()
{
   this.State = null;
}

This really doesn’t seem to do what it says on the tin. Until you look at the definition of state

public State
{
   set
   {
      this.state = value;

      if (value != null)
         fireEvent(value)
      else
         fireEvent(this.lastState)
   }
}

Written by stu

November 9th, 2007 at 10:34 am

Posted in Coding, Geek

6 Responses to 'Fun with Code…'

Subscribe to comments with RSS

  1. Lovely!

    Looks like the person was missing perl, where the invisible side-effects do more than the explicit code.

    while () {
    m/e(.)/ and print unless $1 eq ‘e’;
    }

    sweavo

    9 Nov 07 at 11:02 am

  2. there should be < > between those parentheses

    sweavo

    9 Nov 07 at 11:04 am

  3. Looks perfectly reasonable to me…

    Matt

    9 Nov 07 at 11:13 am

  4. You would say that, Matt ;)

    stu

    9 Nov 07 at 11:21 am

  5. Ah, job security coding.

    flibble

    9 Nov 07 at 12:33 pm

  6. That secure I left… how about Sadistic?

    Matt

    9 Nov 07 at 12:45 pm

Leave a Reply