> On Jul 1, 2016, at 10:28 AM, Nicholas Outram via swift-users 
> <swift-users@swift.org> wrote:
> 
> class methods may mutate "mutable static variables” (singletons), which are 
> dangerous in multi-threaded code.

This is the same argument zh ao made. But instance methods may also mutate 
static variables, so the fact that you’re calling a class method doesn’t make 
the call any more dangerous.

Moreover, mutating instance variables can be just as dangerous for 
multithreaded code (and is a more frequent source of bugs IMHO).

Really, the only significant difference is that a class method can’t modify 
instance variables, so from that perspective it’s actually a bit safer than an 
instance method call!

—Jens
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to