DEV Community

Randel Ramirez
Randel Ramirez

Posted on

Copy By Reference vs Copy By Value Analogy

Earlier on my way home, I was listening to Richard Campbell and Carl Franklin on their show .NET Rocks - 1664 High Performance C# with Steve Gordon(

Carl Franklin commented on a very interesting analogy regarding Copy By Reference vs Copy By Value.

copy by value = making a copy of the file
copy by reference = creating a desktop shortcut

I'm just really amused with his analogy and it got stuck in my head. I've been programming for 8 years and probably that's the easiest way to understand it. 🤔

Discussion (1)

coderljy profile image
JianYueLin • Edited on

In details, copy by value, is just copying the reference of the object, so it can not be rewrite, except tagging ref keyword. So, in my view, copy by value, just can not rewrite reference address,except ref.