.@mjtsai I think the problem you identified in your blog entry permeates Swift - trading predictable runtime perf for "the correct way".
-
-
.
@mjtsai you OFTEN want the way Swift acts but it is not explicit, and something I always try to avoid is code that isn't obvious enough.0 replies 0 retweets 0 likes -
@nuoji Why do you say "not explicit"? Because the "var" may be textually far away?0 replies 0 retweets 0 likes -
@mjtsai var arrays will try to optimize for you, so the actual runtime perf and behavior will depend on subtle variations to your code.0 replies 0 retweets 0 likes -
@nuoji Yes, agreed about the perf being more hidden. I thought you were talking about "explicit" when reading the code.0 replies 0 retweets 0 likes -
@mjtsai compare ObjC - switching between mutable and immutable is completely explicit and inspectable. Including when passing arrays as args0 replies 0 retweets 0 likes -
@nuoji Aren't "var" and "inout" just different ways of spelling "mutable"? That's explicit.0 replies 0 retweets 0 likes -
@mjtsai it only describes the language rules, it does not describe the behavior of the underlying runtime.0 replies 0 retweets 0 likes
@nuoji Tricky implementations of NSData and NSString to link to other immutable objects when you split/join instead of copying data.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
Christoffer Lernö
Michael Tsai