This disregards any of the semantic differences between pointer objects and 
value objects. Plus if you want an api that changes where a reference points 
you still need var parameters. The reason you use value types instead of 
reference types is that you want their semantics. There is more to objects vs 
pointers than "you do not use var".

A few traits of references/pointers are:

-Nilable by default|   
---|---  
-Heap allocated|   
-Can use methods / OOP inheritance|   
-Do not copy on assignment|   
-In parameters `var ref T` is mutable and can be reassigned, but `ref T`cannot 
be|   
-Pointer indirection, when storing a reference objects contigiously there is no 
guarantee they're pointed at values are held contigiously.|   
  
Compared to objects traits:

-Safe initalized value by default|   
---|---  
-Generally stack allocated|   
-Can use inheritance only to copy fields, otherwise you use tagged unions to 
replicate OOP inheritance|   
-Generally copies on assignment(unless using move semantics)|   
-In parameters `T` is immutable and `var T` is required to mutate unless using 
unsafe code and the object is passed as a reference|   
-Collections store the actual structs contigiously which aides performance 
through cache efficiency|   
  
Atleast in my view you decide from the above(and any other traits I missed) 
which to use, since there are reason to prefer one to the other. It's not just 
about a few language semantics it's about how the types are used/program is 
written.

Reply via email to