What do you think about having an FAQ on the official Swift.org site for these kinds of matters? Here are some other related points of confusion I've seen a fair amount (on these forums, StackOverflow, and elsewhere):
- Not all structs have CoW magically implemented for them.
- It's possible for classes to have value semantics, and structs can have value semantics
- Common misconception: Structs are allocated on the stack, and class objects are allocated on the heap (the C# world struggles with this confusion too, see 1, 2)
- People often try to inspect the "address of a struct" as a proxy for some kind of stable identity (which they don't actually have)
- The difference between passing a reference by value (i.e. passing an instance of an object) vs passing a reference by reference (
inout
) - and more?
(Wouldn't it be ironic if I made mistakes in laying out these common misconceptions? )