Thanks for the post! Elaborating on why it is a bad idea to use copy() on data classes with mutable attributes is because if the mutable attributes are updated after the object is copied then both the original and new object will have it’s attribute values altered producing potentially unintended consequences.

--

--

--

Open Sourcer

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adam Hurwitz

Adam Hurwitz

Open Sourcer

More from Medium

The Nature of Reality

Grit is the most important traits to survive. Is it?

STEM for Kids in the Capitol Region