Maybe a few other points to your video:

You say that references are useful when data are shared, you gave an example 
for the case where two objects both have a ref to another object. That is fine, 
but for beginners a larger, real world example would be nice. I think when I 
was a kid data sharing would have made not much sense for me without a more 
detailed use case.

The other point is, that you said that for references we do not need the var 
keyword when passing data to procs -- we can modify the fields of object passed 
as references always. Well, beginners may be confused: Is the most significant 
advantage of references that we don't have to type that var keyword in the proc 
signature? So why not always us references as done in Java and Python, so that 
we never would have to use a var parameter. And related question: When we have 
a ref parameter, how can we avoid that fields can be modified?

Then you were talking about scopes and locality. That was a bit off topic, but 
I know why you did.

Next point: You assigned nil to a ref and show that accessing thet values would 
give a runtime error then. OK, but if I remember correctly you say then that it 
is because the GC has freed the object. That is not really correct, as the 
default refc GC may free objects with delay. When you assign nil to a ref, then 
trying to access the old value would fail, but the object may be still 
somewhere in memory, until GC really frees it.

And finally for ORC: First that does not really belong into this video, maybe 
make a own video for ARC, ORC, move semantic, cursor annotation and all that? 
And, when you want to advertize Nim, it is always a good idea to call ARC not a 
GarbageCollector, but call it Rust like deterministic memory management. Some 
people really like that term better than GC. Yes I know ORC is in between, that 
is why I generally talk about ARC only, most software should work with ARC fine.

Reply via email to