Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: How to build the *weakest* program

Author: Dann Corbit

Date: 11:45:30 08/21/02

Go up one level in this thread


On August 21, 2002 at 00:23:02, Russell Reagan wrote:

>On August 20, 2002 at 23:48:30, Dann Corbit wrote:
>
>>On August 20, 2002 at 23:16:03, Russell Reagan wrote:
>>
>>>On August 20, 2002 at 18:34:29, Dann Corbit wrote:
>>>
>>>>Purely an accident.  According to the ISO C standard, it is perfectly OK for
>>>>execution of the program to cause demons to fly out of your nose (an ancient
>>>>interpretation from news:comp.std.c).
>>>>
>>>>The printf() function is varadic (variable number of arguments).  If you compile
>>>>a varadic function without a prototype in scope, the behavior of the program is
>>>>undefined.
>>>
>>>The levels of truth:
>>>
>>>4. What someone else tells you
>>>3. What you read in a book
>>>2. What you read in the documentation
>>>
>>>and the highest level of truth is...
>>>
>>>1. What the thing does when you run it
>>
>>Seat of the pants programming kills people.  Literally.
>
>It's not best to just try something and go with it just "because it works," I
>agree. But it is best (IMO) that you do what works instead of what is supposed
>to work, if what is supposed to work doesn't.

Software is supposed to be an engineering discipline.  There are standards that
govern the behavior of programs.  They are defined by both national (e.g. ANSI)
and international (e.g. ISO) governing bodies.  They spell out what is allowed
and what is not allowed.  If you find a bug in the compiler, you have a
legitimate complaint against your vendor.  You can change compilers, wait for a
patch, or whatever.  If you just do something that appears to work, it is asking
for trouble.  Will it still work when you change compiler settings?  Will it
work the same on another platform?  You have no idea.  Furthermore, the correct
operation is documented by the standards.  Your guess of how it seems to work is
not.  There are very few bugs in modern optimizing compilers.  Adding in your
own bugs (like neglecting to include a prototype for varadic functions) and
releasing the tool "because it seems to work" is incompetent (in my view) and/or
neglegent.

>I sure wouldn't want the web server that's under my care at my job (not really
>my job, just a hypothetical) to get attacked just because I wrote my script
>according to how it was "supposed" to work, when in reality it doesn't exactly
>work as documented.

The problem is with the tool set you are using then.  Find tools that work and
use those.  If I know my tools are broken, I am an idiot if I continue to use
them.  There *are* rare times when you must use broken tools, I admit.  But if
you have a choice, then you should use good ones instead.  What we are talking
about here is not a choice of broken tools verses good ones.  It is using a
wrench to pound a nail, or a butter knife for a screwdriver.  At least, that is
what we see in the sample provided.



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.