3 ms·
I might be wrong but as I've understood it Builder Pattern is mostly used as a solution to mitigate mutable state from being accidentally shared. Which is duct
by danielscrubs 7y ago
I might be wrong but as I've understood it Builder Pattern is mostly used as a solution to mitigate mutable state from being accidentally shared. Which is duct taping around the complexity instead of removing it.
In Swift the copy on write happens as an implementation detail:
https://stackoverflow.com/questions/43486408/does-swift-copy-on-write-for-all-structs https://stackoverflow.com/questions/43486408/does-swift-copy...
I don't really know why but the coding patterns (what I call culture) that are popular for each language are very, very different even when they can support the same feature-set.
- lostmsu 7y agoMy understanding is C#'s behavior around structs is identical, except it is not called "copy-on-write". From what I see this behavior is identical to copy-always from language spec standpoint of view. If an actual copy is created is down to the code generator, but semantics is the same.
- danielscrubs 7y agoYeah, I really shouldn't have lumped C# and Java together, sorry about that.