Why don't people like lisp?

Tayss tayss_temp at yahoo.com
Thu Oct 23 13:19:50 EDT 2003


Brian Kelley <bkelley at wi.mit.edu> wrote in message news:<3f97eb1f$0$573$b45e6eb0 at senator-bedfellow.mit.edu>...
> The file is closed when the reference count goes to zero, in this case 
> when it goes out of scope.  This has nothing to do with the garbage 
> collector, just the reference counter.  At least, that's the way I 
> understand, and I have been wrong before(tm).  The upshot is that it has 
> worked in my experience 100% of the time and my code is structured to 
> use (abuse?) this.  How is this more difficult?

As I understand, you're arguing that it's ok to let Python's
refcounter automagically close the file for you.

Please read this:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=off&selm=3F1F5297.15D768EF%40alcyone.com
Erik Max Francis explains that expecting the system to close files
leads to brittle code.  It's not safe or guaranteed.

After learning Python, people write this bug for months, until they
see some article or usenet post with the try/finally idiom.  This
idiom isn't obvious from the docs; the tutorial doesn't say how
important closing a file is.  (I was lucky enough to already know how
exceptions could bust out of code.)

Now, I love Python, but this really is a case where lots of people
write lots of potentially hard-to-reproduce bugs because the language
suddenly stopped holding their hands.  This is where it really hurts
Python to make the tradeoff against having macros.  The tradeoff may
be worth it, but ouch!




More information about the Python-list mailing list