DEV Community

Discussion on: "Same Reference" vs. "Same Value"

Collapse
 
drbearhands profile image
DrBearhands

By the Transitive Law of Logic and Mathematics, it then follows that references and values are one and the same

Unless I'm missing something here this is absolutely untrue and I'm not sure what it is you were trying to say. Referencing isn't transitive in the first place and even if it were, if you want equivalence you also need reflexivity and symmetry.

I think the memory graph is confusing, went should point to 'to', not to dev. Admittedly there's little difference with const values.

Other than that good writeup, many beginners struggle with this when exposed to mutability.

Collapse
 
somedood profile image
Basti Ortiz

Yes, I'm aware that went should point to 'to'. I only made it point dev for simplicity's sake, really. I hope it's still understandable nonetheless.

And regarding the Transitive Law, I was just trying to say that believing "references are values because variables are references to a value" should be avoided. Sorry if that didn't come out right.

Anyway, thanks for pointing (See what I did there?) this out.

Collapse
 
drbearhands profile image
DrBearhands

I would then argue in favor of rewording that sentence. The reason being that it might confuse people about what transitivity is (i.e. a property of a specific relation).

A reference to Frege's "Über Sinn und Bedeutung" might be a better fit.

Anyway, thanks for pointing (See what I did there?) this out.

nice one

Thread Thread
 
somedood profile image
Basti Ortiz

Oh, wow. This is some deep philosophical stuff.

Thread Thread
 
drbearhands profile image
DrBearhands

It is, though I must admit I personally detested the subject as I have very different views about what language is. But that's going way too far for a value/reference discussion :P

Thread Thread
 
somedood profile image
Basti Ortiz

Anyway, all jokes aside, I appreciate how you brought up the limitations and flaws of my article. Hopefully future readers will note your points. Thanks!