[swift-evolution] Unify `static` and `class` keywords

Matthew Johnson matthew at anandabits.com
Mon Dec 7 21:33:41 CST 2015


> ... both in terms of boilerplate noise, but also in that it leads them down the wrong path.  Many people would write “type var x : Int” wanting a static member, because they don’t understand how class variables work.
> 
> Your approach would make class members *more* prominent, not less.  We’ve tried this, this is not a theoretical concern.

This is only true as long as final is not the default.  That is obviously an orthogonal issue but it is one I feel is worth reconsidering.  It's interesting to note how final not being the default has caused difficulty in this corner of the language.

Maybe if final were the default and we decide to forgo class variables unification would become possible without the issues that arose the first time around.


More information about the swift-evolution mailing list