Skip to content

Rc/Arc needs a better name than clone #2588

@prasannavl

Description

@prasannavl

Seeing clone all over the codebases makes me cringe with no way to know if it's an expensive one or if it's just a reference increment. One has to dig back all the way to type to understand what it actually means.

Would it not make more sense to have a method like ref or similar that can be used instead of clone ? So, that's its explicit and clear. The ref method could just as well call clone internally. Or perhaps, new_ref. Or a name that makes more sense. Just not clone, (though that has become accepted today in the ecosystem) but the actual semantics are rather different.

Edit: Make it clear that I'm not suggesting that clone be renamed - That's neither my intent nor a solution to the issue. Just looking for potential way to mitigate this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-libs-apiRelevant to the library API team, which will review and decide on the RFC.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions