Python's "only one way to do it" philosophy isn't good?

Chris Mellon arkanes at gmail.com
Fri Jun 29 10:09:43 EDT 2007


On 6/29/07, Douglas Alan <doug at alum.mit.edu> wrote:
> "Chris Mellon" <arkanes at gmail.com> writes:
>
> > You're arguing against explicit resource management with the argument
> > that you don't need to manage resources. Can you not see how
> > ridiculously circular this is?
>
> No.  It is insane to leave files unclosed in Java (unless you know for
> sure that your program is not going to be opening many files) because
> you don't even know that the garbage collector will ever even run, and
> you could easily run out of file descriptors, and hog system
> resources.
>
> On the other hand, in Python, you can be 100% sure that your files
> will be closed in a timely manner without explicitly closing them, as
> long as you are safe in making certain assumptions about how your code
> will be used.  Such assumptions are called "preconditions", which are
> an understood notion in software engineering and by me when I write
> software.
>

Next time theres one of those "software development isn't really
engineering" debates going on I'm sure that we'll be able to settle
the argument by pointing out that relying on *explicitly* unreliable
implementation details is defined as "engineering" by some people.



More information about the Python-list mailing list