[Python-Dev] "with" use case: replacing a file

Nick Coghlan ncoghlan at gmail.com
Fri May 13 18:35:47 CEST 2005


Phillip J. Eby wrote:
> At 07:23 PM 5/13/2005 +1000, Nick Coghlan wrote:
>> Sorry about that (I was in a hurry this morning). It was here:
>> http://www.joelonsoftware.com/articles/Wrong.html
> 
> "Wrong" is an excellent title for that article; it's completely 
> wrongheaded about exceptions.  :)  Great basic idea (make wrong code 
> look wrong), but for all practical purposes the actual specific advice 
> in the article is only meaningful for C, where you can't create real 
> types and there are no exceptions.  In Python, there are *much* saner 
> solutions to his strawman problems.

I have to agree. However, having had to deal with C++'s excuse for exceptions 
(and the effects of C programmers being let loose on them), I can understand 
where he is coming from.

And the basic idea of flow control you can't see being a potential problem is 
sound. For exceptions in general, the benefits are worth the costs, but I don't 
think the same can be said for allowing statement templates the power to 
suppress them.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://boredomandlaziness.blogspot.com


More information about the Python-Dev mailing list