Hi! Please consider following me on twitter: @hanekomu.

Debugging principle: Look under the lamp post

In a blog post, Mark-Jason Dominus talks about how a good place to start debugging is to look under the lamp post. The idea behind that principle is: If you lose your wallet in a dark street start by looking under the lamp post. The wallet might not be there, but you will not waste much time on the search.

For example, if your program accumulates results in an $output variable and something goes wrong, start your search by finding all occurrences of that variable in your code. Don't make elaborate assumptions about who does what in the code. This may sound obvious but sometimes we don't follow that advice. So start looking under the lamp post.

Write a comment | Bookmark and Share

posted at: 15:25 | path: /misc | permalink | 0 comments | 0 trackbacks

Comments are closed for this story.

Trackbacks are closed for this story.