Re: OOP and memory management
From: goose (ruse_at_webmail.co.za)
Date: 06/28/04
- Next message: Gregor Copoix: "Re: Q: C macro's for lvalue statements ? Any C marco Guru's out there ?"
- Previous message: Gerry Quinn: "Re: what does "serialization" mean?"
- In reply to: Calum: "Re: OOP and memory management"
- Next in thread: Corey Murtagh: "Re: OOP and memory management"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 28 Jun 2004 04:24:40 -0700
Calum <calum.bulk@ntlworld.com> wrote in message news:<cbjkck$smd$1@newsg1.svr.pol.co.uk>...
> goose wrote:
>
> > "Thomas G. Marshall" <tgm2tothe10thpower@replacetextwithnumber.hotmail.com> wrote in message news:<uZGCc.2600$L8.2545@nwrdny02.gnilink.net>...
> >
> > <snipped>
> >
> >>You don't see how easy it is to program something when you don't have to
> >>worry about deallocation?
> >>
> >>Sure, you can bind up periodically. But having to worry a few times about
> >>GC congestions is certainly a great trade for not having to worry about
> >>every little allocation.
> >>
> >>Think of all the potential bugs that can occur from a tirade of malloc's,
> >>not from being a dope, but from being human.
> >
> >
> > The problem, from my viewpoint, is not whether or not GC is a
> > good thing to have (it is, right?), but whether the programmer
> > who /needs/ it is a good one to hire.
> >
> > The are more resources that a single program must manage
> > than just memory. Memory allocation/deallocation just happens
> > to be the easiest to manage.
> >
> > Cleaning up after yourself (especially if writing a library)
> > cannot be stressed enough. Unfortunately, reliance on GC for
> > new programmers just means that they never get any experience
> > managing resources properly. No language should /force/ the
> > programmer to rely on GC as this just means that programmers
> > will get forgetful about resource management.
> >
> > all memory allocated must be deallocated.
> > all files opened must be closed.
> > all network connections opened must be terminated.
> > all threads/tasks started must be ended.
> > all temporary files must be deleted.
> >
> > It goes even further when you are managing physical
> > resources, as then you would have to manage creating
> > and deleting queues (think printer spools), or
> > even as far as multiplexing a single ADC channel
> > between n inputs (think about the latency inherent
> > in switching a piece of wire between various
> > sources, and taking the capacitance into account).
> >
> > Not managing memory is the slippery slope of the thin
> > end of the wedge. The programmer who does not learn
> > to manage memory efficiently is not much use other
> > than as a code grunt. When all we have left are languages
> > that dont let the new programmer learn some very important
> > concepts (which hopefully wont be soon), then we must
> > not complain when we get second-rate programmers.
>
> Interesting... I think that there is a generational thing going on here:
> any tool that makes life "too easy" is not "proper programming".
I never said nor implied that. Read above where I said that the language
should not /force/ one to use GC.
> I
> expect people who have used card feeders smirk at how easy us people
> with hard disks have it.
>
> Personally I feel very lucky to have been able to program on a ZX81 with
> a wobbly RAM-pack, or to scratch my head over random segmentation faults
> in C. Kids of today have it far too easy! (and I'm only 30 ;-) It
> makes you realize how much you can achieve with so little by not
> squandering resources. I too feel that people who have not experienced
> this have missed out, are not so careful with resources, and have no
> motivation or ability to write tight code.
>
> The down-side is to not accept new technologies when they do offer
> improvements. Making life easy is a good thing. Make kids learn C,
> since then they'll actually see how a language executes, and then
> they'll appreciate the newer language features. Unfortunately you
> really need to get your hands dirty to really get to grips with a
> language, so the art of programming as we romantically remember it may
> be a dying art.
>
> But like snaring rabbits or building a dry-stone wall, these skills may
> not be necessary in the future??
>
I really doubt that resource management is not necessary for the future.
/Just maybe/ we can get away with having automatic memory management,
but the whole point of using a machine to do hundreds of calculations
and lookups per second is to streamline our resources.
Programmers who think that they need not have any ability managing
resources are going to be just as piss-poor at writing software as those
that think that theres no need to learn arithmetic.
Once again, I dont think that GC is bad (anymore:-), I think that a
language that *forces* one to use GC (and there are quite a few of those)
is going to have naturally poor programmers.
goose,
- Next message: Gregor Copoix: "Re: Q: C macro's for lvalue statements ? Any C marco Guru's out there ?"
- Previous message: Gerry Quinn: "Re: what does "serialization" mean?"
- In reply to: Calum: "Re: OOP and memory management"
- Next in thread: Corey Murtagh: "Re: OOP and memory management"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|