GC a crutch?

Dan murpsoft at hotmail.com
Mon Mar 26 09:29:28 PDT 2007


> Walter Bright wrote:
> >> Which "wrong" assertions are those?
> > gc is a crutch for lazy/sloppy/less capable programmers, gc isn't for 
> > mission critical industrial apps, gc is for academic unusable languages, 
> > etc.

0ffh Wrote:
> I admit I used to think similar to that, a somewhat longer while ago.
> What made me change my mind was that Greenspun's Tenth Rule also
> includes GC: I find that doing the dynamic memory management myself
> results not only in bigger and more fragile source code, but also
> may perform worse than GC unless I go about it very warily.
> 
> I think it is just not efficient to put a lot of work into that
> with every application - it's much more efficient if somebody
> solves the problem *once*, and properly, and that's that.

I totally agree that GC is a solid way of cutting bad code, which performs far worse than the usually trivial overhead of having a GC.  

I do think though that it should be somewhat easier to declare something as not being under the gc's influence so that when we want to be wary and we're scratching for an extra 10% performance in a loop, we can do so more readily.

~~

At first I was astonished to see my 26kb source compiled to a whopping 82kb.  I was wondering if it imported all of phobos...
Now I've realized that that extra mass did all the dynamic array stuff, associative array stuff, gc and phobos.  Things that would have taken me just as much in source to write...



More information about the Digitalmars-d mailing list