Description
This is purely an ergonomic issue and therefore subjective, and it's also a breaking change. But since you're still at 0.1 this seems like a good time for this kind of feedback :)
Basically, I think shared should be the default because all Objective-C objects can be shared by default because they all have reference counting. When I see an id
in Objective-C code, I assume it can be shared until proven otherwise. I would like to be able to use the same mindset with Rust, except that once I as the programmer prove that it is not shared, I can explicitly use an OwnedId
and have that invariant enforced by the compiler (at least on the Rust side of things).
Additionally, since the owned vs shared aspect is not enforced in any way on the Objective-C side of things, that means it's far more safe to assume that everything is shared by default (even init
methods might retain and share self
with some other object, so there is no guarantee that even an object you just created is owned in the Rust sense). So it makes more sense to me to have the shared version be the default, only switching to the owned variant when safe and necessary.