Christopher Smith wrote:
Finalizers are not destructors, and arguably actually have more problems
than destructors.
You are correct in that finalizers are not destructors. Them having
more problems than C++ destructors is just patently not true.
4) multiple inheritence
Java does provide for it. It is awkward to implement, but can be done
through the use of interfaces and mixin classes. It is also very rarely
needed.
It's rarely *used*, not rarely *needed*. The hacks for doing mixins in
Java (even with generics) don't allow you to do policy based design.
Thank you, type erasure.
At this point, you are treading into different territory. You really
want *strongly-typed, but not statically-typed*.
You really should be stepping out of the C/C++, Java, and C# language
space into something different.
If you can show me how to do policy based resource management in Java
(i.e. no "finally" blocks in the application code), I might agree with
you. Otherwise, arguments that Java is "better" than C++ are kind of
irrelevant to whether Java has this capability.
And C++ doesn't have this capability, either. Sorry.
I *really* suggest a long dive through Herb Sutter's books. While you
see the beginnings of exception-safe C++, you fail to understand some of
the subtleties in constructors, resource-acquisition-is-initialization,
exceptions, and destructors.
-a
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg