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

Guido van Rossum wrote:
P.S. The points regarding non-local flow control in Joel Spolsky's latest Joel on Software article (especially the links at the end) may have had something to do with my change of heart. . .
I'm a big fan of Joel. Care to share the specific URL for the article you're referring to?
Sorry about that (I was in a hurry this morning). It was here: http://www.joelonsoftware.com/articles/Wrong.html The link of particular interest regarding exception handling was this one: http://blogs.msdn.com/oldnewthing/archive/2005/01/14/352949.aspx Some interesting points about some of the cons of exception based code (at least some of which relate to what we're dealing with in factoring out finally clauses, and C++ deals with via scope-based destruction). Anyway, it made me realise that having any callables you invoke potentially raise exceptions is already tricky to deal with, and allowing a different call to potentially *suppress* those exceptions is a recipe for serious confusion. Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia --------------------------------------------------------------- http://boredomandlaziness.blogspot.com

At 07:23 PM 5/13/2005 +1000, Nick Coghlan wrote:
Guido van Rossum wrote:
P.S. The points regarding non-local flow control in Joel Spolsky's latest Joel on Software article (especially the links at the end) may have had something to do with my change of heart. . .
I'm a big fan of Joel. Care to share the specific URL for the article you're referring to?
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.

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@gmail.com | Brisbane, Australia --------------------------------------------------------------- http://boredomandlaziness.blogspot.com
participants (2)
-
Nick Coghlan
-
Phillip J. Eby