I think I have my answer for my original question already. I will just a 
proposal about what I would like to change here in the forums. It then has full 
potential to be moved into an official document, whatever form that might be. I 
really like the interactive part here, and the forum is not too crowed that it 
would disapper too quickly.

To answer your questions, I really like to use destructors for anything that 
would need a defer, meaning, closing files, closing connections, closing 
dynamically loaded libraries, and freeing memory. And if I use them for that, 
they really need to be called reliably at the end of the scope. Not like java 
finalizers. I already don't use garbage collection, and that is already a 
feature at this point in time, why I like Nim. I would use the ref type only 
for things, where the ownership is not only shared, but the lifetime of both 
owners is independant of the other. For example when I need to share an object 
between threads. But that rarely happens in my current code, not at all. Unique 
pointers from c++ are nice, but they need move semantics in the language, which 
does not exist in Nim, at least not explicit.

Reply via email to