|
|
Warp wrote:
> Paul Fuller <pgf### [at] optusnetcomau> wrote:
>> 1) On Garbage Collection, I regard this as a huge factor in favour of
>> C# and .Net.
>
> Garbage collection is not the Holy Grail of programming (nothing is).
> And you have to know about its weaknesses. Certainly these weaknesses
> may not be relevant in many cases, but in some cases they may be.
Actually, I just got through reading a section about how to set up your
objects to be destroyed as soon as possible, rather than waiting for the
normal run of the GC. You implement a certain function ("Dispose", I
think it was), and make a single call to the GC telling it that this
class needs immediate destruction.
Then, any instances of that class are destroyed as soon as possible (re:
when they go out of scope, usually), similar to how objects in C++ are
destroyed.
I just remembered another point I was thinking, though.
The whole point of GC is to make memory management easy. In fact,
that's why languages like Java and C# don't like pointers. However,
they're really sidestepping the issue, because memory management is
*hard*. You don't get rid of the problem by masking it with prettiness;
instead, you need to train better programmers.
If someone can't logically think through the memory usage of their
program, maybe they shouldn't be programming.
--
...Ben Chambers
www.pacificwebguy.com
Post a reply to this message
|
|