Why Doesn’t .NET Support Deterministic Finalization?

This email from Brian Harry has been making the rounds again lately.  It's a pretty in depth talk about the reasons why .NET doesn't support deterministic finalization, including the history behind it.  I found it a pretty interesting read.  The mail's a bit old though, from October 2000, so he's talking about beta bits of the v1.0 framework.  What I found pretty funny was his talk about the using / IDisposable features of C# in the future tense:

“PROPOSAL - There is a proposal here to add syntax that would make this look
like the following.  The compiler would effectively expand this code to to
the code above.  Please understand that by telling you we are considering
this, I am making no commitment and this is not a spec.  The IDisposable
interface I mentioned earlier would help the compiler disambiguate the
method to call at the end of the scope.  I would like to get your feedback
on the idea however.  Obviously there are subtle variations on the syntax
you can invent.  We believe that this makes the very common design pattern
quite a bit more palatable.
        using (File f = new File("c:\tmp")) {
                byte[] b = f.Read();

And then his thought that this feature probably won't make the cut:

“We are closest to the border on [using] but I'd say we are slightly disinclined
to do it, again because it is really not more than syntactic sugar and we
are prioritizing shipping very high.”

It's always fun to look back on old mail about design decisions that are being made and compare that to the current state of the project.  Leads to lots of “wow, we were considering that?”  moments 🙂

Comments (1)

  1. Yosi Taguri says:

    I think it was Chris Sells Idea

Skip to main content