Closed zone-1614 closed 1 year ago
These are structs, which are passed around as tuple value type instances, instead of references to class type instances. It is recommended practice to make such structs immutable (readonly) - making them mutable is usually only confusing, as any mutation is ephemeral and invisible anywhere but the current instance and stack frame.
Embrace this pattern - it's good for performance and multithreading! Create new instances instead. This is precisely what the record type and its "with" syntax was made for.
Thank you. I'm not familiar with c# and I didn't know the "with" syntax before.
Why not provide some ways to change the X, Y, Z of Point3D or Vector3D? Are there any considerations?