I had some very wrong sounding advice recently from a "senior" developer/coworker regaurding the C# garbage collector such as...
"You need to use destructors everywhere in C# because the garbage collector cannot be relied upon."
"The C# garbage collector cannot be thought of like the Java garbage collector".
This sounds extremely fishy to me, as far as I know the differences between the C# and Java garbage collectors are as follows...
- The C# is a Generational garbage collector, Java is concurrent mark sweep in 1.6 with G1 being the new default (generational) garbage collector featuring Java 7 and has been optional since ~1.6.21. As far as I know
- C# as a language has the ability to manaully dispose of objects that implement IDisposable. Java must always use garbage collection although some frameworks like SWT require you manually call methods to release memory in the underlying native code.
I realize that Java and C# are just the languages and the garbage collectors are a component of the runtime, however for this case I am specifically speaking about the Sun/Oracle JVM and the Microsoft .net Runtime.
Does anybody have feedback?