Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: need an advice how to detect a bug

Author: Miguel A. Ballicora

Date: 16:27:34 11/04/02

Go up one level in this thread


On November 04, 2002 at 13:31:40, Robert Hyatt wrote:

>On November 04, 2002 at 12:10:07, Miguel A. Ballicora wrote:
>
>>On November 04, 2002 at 09:39:14, Vincent Diepeveen wrote:
>>
>>>On November 04, 2002 at 06:40:14, Pham Minh Tri wrote:
>>>
>>>
>>>I hardly use asserts in DIEP. If i need one i usually use a
>>>printf, which gets removed using a // when it is tested well
>>>and a year later or so removed.
>>>
>>>I guess bob has the same habit.
>>
>>Interesting.
>>For Uri: do use asserts!. It is important not to copy the bad habits of talented
>>programmers.
>>Good habits are for us, mortals, and they work.
>>
>>Miguel
>
>I don't consider an assert() as "good" or "bad".  It is just _one_ tool you can
>use.  But it doesn't provide enough information, in general.  I have some code
>that does much more than a simple assert, so that I can call it where it is
>needed
>and it provides a lot of information about what is wrong and the circumstances
>when it goes wrong.
>
>I do use asserts when appropriate.  I use other things as well.
>
>Don't become "the man with a hammer who thinks everything therefore looks like
>a nail..."
>
>Different tools for different circumstances is a sign of flexibility, it is
>_far_ from
>a "bad habit".

The original poster talked about "hardly using" and at one point "removing"
debugging code. I do not know what you do, but my advice to Uri is:
Use asserts(), used debugging code, use them heavily, and never remove them!
I believe that it is a 'good' habit and the lack of it is 'bad', at least for
mortals like me.

Miguel



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.