Patterns of Bugs

Walter Bright newshound2 at digitalmars.com
Fri Jan 7 10:47:43 PST 2011


Max Samukha wrote:
> On 01/06/2011 09:38 PM, Walter Bright wrote:
>> http://www.drdobbs.com/blog/archives/2011/01/patterns_of_bug.html
>>
>> (dedicated to bearophile!)
>>
>> Anyone want to post it on reddit?
> 
> Good points. However, computer hardware analogies are a bit outdated. 
> For example, USB is prevalent nowadays. You connect a USB keyboard, 
> mouse or whatever to a slot, which is closest to you and forget about 
> it.

Yes, USB is a big improvement. So is SATA.


> Also, memory module connectors are incompatible starting from I 
> believe DDR. You won't be able to stick DDR2 module into DDR slot. 
> Actually, this applies to almost any modern PC component.

I put together a new box a couple weeks ago. The memory card would fit in one of 
4 slots. The first one I tried it in resulted in a computer that just beeped at 
me. No help from the manual at all, I was ready to RMA the mobo back, until I 
had the idea of putting the card in a different slot. The second one I tried worked.

You're right that many things in the computer hardware are better. But still, 
many connections to the mobo can be done wrong. For example, all the pins coming 
from the front panel. Some of them, like the hard drive LED, don't even indicate 
the polarity on the connector, and you have to try it both ways until you figure 
out which one works.


> I'm afraid the principles you are describing are not something new in 
> the software industry. I can't remember the first time I heard the term 
> "fool-proof software".

I'm not saying they are new - heck, trying to eliminate buggy code patterns goes 
back to trying to get rid of goto. And, of course, many static analysis tools 
attempt to identify obviously buggy but legal C patterns.


More information about the Digitalmars-d mailing list