Article of interest: Python pros/cons for the enterprise

Jeff Schwab jeff at schwabcenter.com
Thu Feb 21 19:17:53 EST 2008


Carl Banks wrote:
> On Feb 21, 1:22 pm, Nicola Musatti <nicola.musa... at gmail.com> wrote:
>> There are other downsides to garbage collection, as the fact that it
>> makes it harder to implement the Resource Acquisition Is
>> Initialization idiom, due to the lack of deterministic destruction.
> 
> That's not a downside: it's at least a wash.
> 
> In C++ you manage memory and the language manages resources.  In
> Python you manage resources and the language manages memory.
> 
> RAII is merely one way of minimizing complexity.  Garbage collection
> is another way.

If you've already got a generic, language-supported way to manage 
resources (like RAII with deterministic destruction), then why bother 
with garbage collection?  I'm not trying to knock it; it was a big step 
up from C-style "who forgot to delete a pointer" games.  It just seems 
to me like a solution to something that's no longer a problem, at least 
in well-written C++ code.  I'll take destructors over GC any day.



More information about the Python-list mailing list