Re: Article of interest: Python pros/cons for the enterprise



On Feb 21, 7:17 pm, Jeff Schwab <j...@xxxxxxxxxxxxxxxx> wrote:
Carl Banks wrote:
On Feb 21, 1:22 pm, Nicola Musatti <nicola.musa...@xxxxxxxxx> 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?

Because now you have to manage memory? Did you read my post? You
have to manage one thing or the other.


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.

About 2% of the objects I creat have resources other than memory. I
would rather manage resources of 2% of objects than manage memory of
100%. YMMV, but I suspect mine is the more common opinion, if the
recent (like, 10-year) trend in programming languages is any
indication.


Carl Banks
.



Relevant Pages

  • Re: How come Ada isnt more popular?
    ... bother with *manual* memory management neither. ... Today manual memory management is a low-level thingy that you don't have to care about, unless you *really* want to. ... The problem is that few programs rely on only memory and in a typical case there are lots of resources that are not memory oriented and they have to be managed, ... When GC is a shiny center of the language, those other kinds of resources suffer from not having appropriate support. ...
    (comp.lang.ada)
  • Re: Why do some people hate java?
    ... C++ templates can do some things that Java generics can not. ... memory is the only resource that must be managed. ... and other resources that are just as important to ... To the extent that the language ...
    (comp.lang.java.programmer)
  • Re: Article of interest: Python pros/cons for the enterprise
    ... due to the lack of deterministic destruction. ... In C++ you manage memory and the language manages resources. ... You seem to be saying there's some kind of trade-off between automatic management of dynamically allocated memory, and automated management of other kinds of resources. ...
    (comp.lang.python)
  • Re: Article of interest: Python pros/cons for the enterprise
    ... due to the lack of deterministic destruction. ... In C++ you manage memory and the language manages resourcewithout bringing ... trade-off between automatic management of dynamically allocated memory, ... and automated management of other kinds of resources. ...
    (comp.lang.python)
  • Re: Article of interest: Python pros/cons for the enterprise
    ... due to the lack of deterministic destruction. ... In C++ you manage memory and the language manages resourcewithout bringing ... trade-off between automatic management of dynamically allocated memory, ... and automated management of other kinds of resources. ...
    (comp.lang.python)