[deleted]
Untitled topic
1–3 of 3 posts
Re: undefined
#2I use to program in VB6, and it used reference counting. CPhyton still use automatic reference counting (with some trick to break cycles). In both cases, the increments and decrements are automatically handled by the compiler. More examples: http://en.wikipedia.org/wiki/Reference_counting#Examples_of_...
Reference counting is not a bad idea until you have to deal with cycles. Once you need to use cycle of references you have to be extremely careful to break it or the code will leak memory. And sometimes, with complex code, the cycles are not obvious. There are some methods to deal with cycles, but all of them are painful. http://en.wikipedia.org/wiki/Garbage_collection_(computer_sc...
Re: undefined
#3Just because you don't know more languages with reference counting doesn't
mean there are none. Perl, Python and Ruby use this technique (Python and Ruby
additionally use GC). I wouldn't be surprised learning that embeddable
languages like Lua also use refcount.
It's just that refcount has its serious drawbacks, for example inability to reclaim the memory in the case of cyclic data structures.