Lightbulb-SOLUTION-Don't read if you don't want to know!

Richard Masoner (richardm@cd.com)
Fri, 24 Oct 1997 14:22:29 -0500 (CDT)



> Of course, this takes advantage of several *UNSTATED* assumptions:

Two more unstated assumptions are that we know that all three switches
are in the "off" position when we start, and that we know somehow which
switch position is "off" and which is "on."

> Do engineers spoil all your fun?  For engineers, this kind of
> technical discussion -- looking for holes in a design -- *IS* fun: its
> called a design review!

Not only that, assumptions will "get" you.  I wrote some code very
recently where I assumed that a request to allocate zero bytes would
result merely in a NULL pointer.  I didn't bother to test my assumption,
primarily because of time pressures.

The real result -- at a customer site no less -- was a system PANIC :-(
The routine that allocates the memory specifically tests for a request
for zero bytes.  If that assertion fails the function calls panic()
instead of returning NULL.

The RISKS Forum on the Internet (news:comp.risks and elsewhere)
discusses this type of stuff in detail.

Richard Masoner
Champaign Illinois USA