# What is the difference between copy and deepcopy?

**URL:** <https://discourse.julialang.org/t/what-is-the-difference-between-copy-and-deepcopy/82149>\
**Category:** General Usage\
**Tags:** deepcopy\
**Created:** [June 2, 2022, 7:51pm UTC](https://discourse.julialang.org/t/what-is-the-difference-between-copy-and-deepcopy/82149 "2022-06-02T19:51:39Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![liuyxpp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/liuyxpp/32/9870_2.png) [@liuyxpp](https://discourse.julialang.org/u/liuyxpp)\
**Post date:** [June 4, 2022, 3:26am UTC](https://discourse.julialang.org/t/what-is-the-difference-between-copy-and-deepcopy/82149/21 "2022-06-04T03:26:55Z")

</div>

Even `deepcopy` sometimes leads to bugs that I don’t understand. Instead, I reconstruct my object from scratch in such cases.

---

<div class="post-metadata">

**Author:** ![Elrod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elrod/32/22461_2.png) [@Elrod](https://discourse.julialang.org/u/Elrod)\
**Post date:** [June 4, 2022, 3:36am UTC](https://discourse.julialang.org/t/what-is-the-difference-between-copy-and-deepcopy/82149/22 "2022-06-04T03:36:20Z")

</div>

As an aside, this is another example of explicit parameter frameworks (e.g. Lux.jl and SimpleChains.jl) being simpler to work with and understand.

But I agree that with implicit parameters, `copy` should be defined to also copy these underlying parameter arrays.

[Previous page](https://discourse.julialang.org/t/what-is-the-difference-between-copy-and-deepcopy/82149.md?page=1)
