In message <mailman.778.1289325458.2218.python-l...@python.org>, Terry Reedy 
wrote:

> I've been wondering why C programmers keep writing code susceptible to
> buffer overruns ;=).

I am continually disappointed with the ‘do as I say, not as I do” attitude 
among people offering up sample code. I remember writing to one contributor 
to a programming magazine many years ago, about his admonition not to simply 
copy-and-paste sample code, to point out that he had done exactly that 
(complete with bug).

The main sticking point seems to be error checking; for some reason, writers 
of sample code seem to believe the code is “clearer” if you leave this out, 
when in fact all real-world applications of the illustrated techniques would 
include the error checks. So what do they end up illustrating? Nothing 
relevant to the real world.

Is this why so many real-world programs fail to check for errors in 
important places, and segfault or behave unpredictably instead of gracefully 
reporting a problem?
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to