TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
C# Coding Standard

Rule:  5@111Checked automatically with code checker

Synopsis:Avoid implementing a finalizer
Severity Level:4
Category:Object lifecycle


If a finalizer is required, adhere to [5@112] and [5@113].

The use of finalizers in C# is demoted since it introduces a severe performance penalty due to way the garbage collector works. Note also that you cannot predict at which time the finalizer is called (in other words, it is non-deterministic).

Notice that C# finalizers are not really destructors as in C++. They are just a C# compiler feature to represent CLR Finalizers.