C++ has been around long enough to have had several distinct epochs of style and best practice. It's not necessary to do much manual heap management in modern C++.
And the subtle upside of using ref-counting is that the ownership and lifetime of your data becomes self-evident in the types. It takes awhile to appreciate that, but it makes garbage collection feel a bit like dynamic typing: yes, it requires you to think less, and there are heroic, inspiring optimizations behind it, but ultimately makes it harder to understand the runtime behavior based on just looking at the code.
This post is interesting because he's identifying those limitations of GC: he's ending up having to add reference management to his GC code, by making sure to null out references, etc. It's nice to have the type system do that for you.
Anyone who thinks this is necessary should check out boost::shared_ptr, weak_ptr, and scoped_ptr:
http://www.boost.org/doc/libs/1_42_0/libs/smart_ptr/smart_pt...
C++ has been around long enough to have had several distinct epochs of style and best practice. It's not necessary to do much manual heap management in modern C++.
And the subtle upside of using ref-counting is that the ownership and lifetime of your data becomes self-evident in the types. It takes awhile to appreciate that, but it makes garbage collection feel a bit like dynamic typing: yes, it requires you to think less, and there are heroic, inspiring optimizations behind it, but ultimately makes it harder to understand the runtime behavior based on just looking at the code.
This post is interesting because he's identifying those limitations of GC: he's ending up having to add reference management to his GC code, by making sure to null out references, etc. It's nice to have the type system do that for you.