Let me add to the excellent advice already given:

* Show the code to another programmer (aka "peer review")

* Read a good book on general programming practices, including debugging.

One such book is The Practice of Programming by Kernighan & Pike.  Here are 
some section titles from chapter 5, "Debugging":

Examine the most recent change
Don't make the same mistake twice
Debug it now, not later
Get a stack trace
Read before typing
Explain your code to someone else
Make the bug reproducible
Divide and conquer
Study the numerology of failures
Display output to localize your search
Write self-checking code
Write a log file
Draw a picture
Use tools
Keep records

Two other books of this type are:

Writing Solid Code by Steve Maguire
Code Complete by Steve McConnell

-David

On Friday, May 04, 2001 1:56 PM, Hubert Earl [SMTP:[EMAIL PROTECTED]] 
wrote:
> Hi,
>
> What's the best way to deal with inexplicable error messages?  Is it:
> a.  to slog away at the problem until the solution is found?
> b.  to do something else, then come back after a while?
> c.  to redo the code from scratch?
>
> I'd appreciate words of wisdom from cooler, more experienced heads, since
> there *must* be a way to avoid the enormous frustration I often feel while
> coding! :-)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to