On 30/12/12 4:24 AM, Jochen Kunz wrote:
On Sun, 30 Dec 2012 02:22:59 -0500
Toby Thain<toby at telegraphics.com.au> wrote:
Maybe you
haven't looked at C++ in a while. Modern C++ is a single
language that can encompass many programming styles.
Except those styles enabled
by real, designed-in garbage collection.
There are reasons why most higher level languages use it. :)
I am very thankfull
that C++ doesn't impose garbage collection on me,
Of course we have many choices of which C++ is one. Nobody will take it
away from you :)
but gives me the choice to use it where apropriate. It
is very
disturbing to me that I can't use the RAII idiom in Java and have to
work around this with try-catch-finally. So you get automatic memory
management, but you have to manage your resources manualy. Thats
awkward und cumbersome.
And I surely don't want a garbage collector when programming C++ on a
8 bit microcontroler with a few dozen bytes of RAM...
Of course, I didn't imply that *every* program should use garbage
collection. (Though you might be interested in some of the research into
Scheme systems in tiny microcontrollers...)
I was referring to higher level languages which are appropriate for
business/web/general problems. The existence of full garbage collection
can offer many first order and higher order benefits there (for example,
imagine managing object lifetimes given non trivial use of closures and
closure environments).
--T
As allways:
One size does not fit all.
Different jobs need different tools.