Re:Should I use a Swift struct or a class?
by mikeash on Saturday July 04, 2015 @08:44PM
(#9832092)
The thing is, every language I'm familiar with has some types with value semantics. Numbers, for example, are pretty much always values. Pretty much nobody is surprised at the behavior of code like this in languages like Ruby and JS:
It seems that, for whatever reason, people understand this but have a really hard time generalizing it. It's not even a matter of custom types being a confounding factor, as I've seen deep confusion over the fact that Swift collections have value semantics.
[ Parent
| on HN ]
There are no comments on this comment yet.