What was I thinking?



  • While looking through some older code, I found the following:

    if(bChanged)	/* The bChanged result is valid for 10.3 and later */
    {
    	int aardvark, kiwi;
    	aardvark++;
    	kiwi = aardvark;
    	break;
    }
    

    I re-write this module about six years ago, so it's got to be something of mine, but I haven't a clue why I did it.



  • @Carnildo said:

    kiwi = aardvark;
     

    you obviously managed to quite directly relate two very distant evolutionary relatives. darwin may rise from his grave to congratulate you



  •  The choice of variable names is interesting, but more interesting is code that increments an uninitialised variable, assigns the result to another then discards them both. I think (or at leat hope) that some code was edited out.

     



  • My usual guess when I find code of mine that looks like this is

    a) I was testing what happens when you do something "not allowed" like assigning from an uninitialised variable, or needed that particular compiler warning for some reason

    b) Was introducing some kind of busywork that wouldn't be optimised away so that I could stick a breakpoint on it

    Though it would make a better story if there were some hilarious anecdote behind it...


Log in to reply