Author: Robert Hyatt
Date: 20:19:27 11/04/02
Go up one level in this thread
On November 04, 2002 at 19:27:34, Miguel A. Ballicora wrote: >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 In that case we agree. The "distributed" crafty source has a lot of debugging code included, but protected by preprocessing directives to exclude it unless needed. I discovered the utility of that 25 years ago, after writing and re-writing debugging code during the early days of Cray Blitz...
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.