[gclist] More advice required

Charles Fiterman cef@geodesic.com
Thu, 10 Jun 1999 14:04:49 -0500


Finalizers are a mistake. Finalizers are doomed.

Your article makes it clear that finalizers should never be used for
anything you actually need to have done. If you need it fast, or sure don't
use finalizers. Only code that can safely be commented out should be put in
a finalizer. That means the cleanest most reliable, reproducible and
portable implementation of finalizers is never to run them. And the best
way to document such a feature is to leave it out of the manual.

People test things. They see a feature like finalizers in Java and write a
little program to test that it works. Works means always works in the mind
of the user. They say "I built 1,000,000 finalizable objects and only
999,852 of them finalized by my counter therefore your entire Java
implementation is a buggy piece of shit and I wont trust it for anything.
Not only that I'll tell my friends." And people who check things out like
that have friends who really trust their opinions. I don't know the name of
the language of the future but it will pass their tests.

A substantial percentage of Java service calls are about unreliable
finalizers. Service calls are expensive. We are shifting from an industry
in which the really smart people do development to an industry where the
really smart people do customer service. Medicine is like that. I don't
know the name of the language of the future but it will be designed to
reduce service calls.

One of the base promises of Java is portability but finalizers chose to run
under such quirky conditions that only implementations that ignore
finalizers are portable. Otherwise your program will run one way on one
machine and another way on the next. I don't know the name of the language
of the future but the rising cost of programmer time convinces me it will
be portable.

First latency gave garbage collection a bad name, now its finalizers. We
solved latency with clever algorithms, the only way to solve finalizers is
to eliminate the feature.

The basic promise of finalizers is fundimentally wrong to make even if you
could keep it. A garbage collector says "I'll give you the illusion of
infinite storage by freeing objects that can never influence the order of
execution again." Finalization says "Once an object can never influence the
order of execution again I'll run a function that knows its address so it
can influence the order of execution." Out out damned spot. All the
perfumes of Arabia will not sweeten this bad idea.


Charles Fiterman		  Geodesic Systems
414 North Orleans Suite 410	  Phone 312 832 2015
Chicago IL 60610-4418           FAX   312 832 1230
				  http://www.geodesic.com

...computers in the future may have only 1,000 vacuum tubes 
and weigh only 1/2 tons.  --  Popular Mechanics, March 1949