substack.com/@bolinirl/note/c-51726774

Preview meta tags from the substack.com website.

Linked Hostnames

1

Thumbnail

Search Engine Appearance

Google

https://substack.com/@bolinirl/note/c-51726774

Bo Lin (@bolinirl)

Yes, that ultimately comes down to how hot the code path is and the asymptotic complexity of the `clone` method itself, which are very much influenced by the nature of your application. What we're saying is that, in the context of "fast development", it's a beneficial mental model to treat cloning as cheap and expendable, *until proven otherwise*. Perhaps a direct corollary here is that it would generally be a good idea to design your datastructures *such that* clones are as cheap as possible (e.g. by making it shallow), since `Clone` is such an integral part of Rust ownership model. That way you set it up so you can use clone "guilt-free" to satisfy the borrow checker, while relegating the deep copy to an explicit method for those (much rarer) cicurmstances that needs it.



Bing

Bo Lin (@bolinirl)

https://substack.com/@bolinirl/note/c-51726774

Yes, that ultimately comes down to how hot the code path is and the asymptotic complexity of the `clone` method itself, which are very much influenced by the nature of your application. What we're saying is that, in the context of "fast development", it's a beneficial mental model to treat cloning as cheap and expendable, *until proven otherwise*. Perhaps a direct corollary here is that it would generally be a good idea to design your datastructures *such that* clones are as cheap as possible (e.g. by making it shallow), since `Clone` is such an integral part of Rust ownership model. That way you set it up so you can use clone "guilt-free" to satisfy the borrow checker, while relegating the deep copy to an explicit method for those (much rarer) cicurmstances that needs it.



DuckDuckGo

https://substack.com/@bolinirl/note/c-51726774

Bo Lin (@bolinirl)

Yes, that ultimately comes down to how hot the code path is and the asymptotic complexity of the `clone` method itself, which are very much influenced by the nature of your application. What we're saying is that, in the context of "fast development", it's a beneficial mental model to treat cloning as cheap and expendable, *until proven otherwise*. Perhaps a direct corollary here is that it would generally be a good idea to design your datastructures *such that* clones are as cheap as possible (e.g. by making it shallow), since `Clone` is such an integral part of Rust ownership model. That way you set it up so you can use clone "guilt-free" to satisfy the borrow checker, while relegating the deep copy to an explicit method for those (much rarer) cicurmstances that needs it.

  • General Meta Tags

    14
    • title
      Bo Lin (@bolinirl): "Yes, that ultimately comes down to how hot the code path is and the asymptotic complexity of the `clone` method itself, which are very much influenced by the nature of your application. What we're saying is that, in the context of "fast development", it's a beneficial mental mo…"
    • title
    • title
    • title
    • title
  • Open Graph Meta Tags

    9
    • og:url
      https://substack.com/@bolinirl/note/c-51726774
    • og:image
      https://substackcdn.com/image/fetch/$s_!XCt4!,w_400,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Freader%2Fnotes-thumbnail.jpg
    • og:image:width
      400
    • og:image:height
      400
    • og:type
      article
  • Twitter Meta Tags

    8
    • twitter:image
      https://substackcdn.com/image/fetch/$s_!XCt4!,w_400,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Freader%2Fnotes-thumbnail.jpg
    • twitter:card
      summary
    • twitter:label1
      Likes
    • twitter:data1
      3
    • twitter:label2
      Replies
  • Link Tags

    18
    • alternate
      https://substack.com/@bolinirl/note/c-51726774
    • apple-touch-icon
      https://substackcdn.com/icons/substack/apple-touch-icon.png
    • canonical
      https://substack.com/@bolinirl/note/c-51726774
    • icon
      https://substackcdn.com/icons/substack/icon.svg
    • manifest
      /manifest.json

Links

4