Last resort debugging

September 4, 2009

When all else fails, I use The Scientific Method:

  1. comment out half the code
  2. see if I still get the bug
  3. if no then uncomment half the commented-out code and go to step 2
  4. if yes then comment out half the un-commented-out code and go to step 2

It’s fairly rare I need to do this in php, but currently hacking in vbscript which I don’t know at all …

Advertisements

3 Responses to “Last resort debugging”

  1. Kae Verens Says:

    you could probably also name this the “binary search” method, as each test cuts the search rows in half.

    • cormacscode Says:

      Actually, that’s a better name – The Scientific Method implies forming a hypothesis and then testing it, doesn’t it? More or less the exact opposite of this, which I use when I’ve totally run out of hypotheses


  2. I put into practice the method i think i got good name to this method.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: