> On Jul 1, 2016, at 9:38 AM, zh ao <owe...@gmail.com> wrote:
> 
> Swift forces you to use class name to alert you on the fact that static 
> variables and methods (may) affect the other instances of the class as static 
> variables are shared between instances. That does make sense.

I disagree. Both static and instance methods can affect other instances of the 
class. In other words, just looking at these two calls:
        something()
        MyClass.something()
there’s no way to tell whether either or both of them change class-wide state. 
(To spell it out clearly: the implementation of the instance method something() 
might change the variable MyClass.staticState.)

I think the reasoning behind this syntax is simply to make it easy to 
distinguish usages of static members (methods or variables) from instance ones.

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

Reply via email to