"Actors are reference types, but why classes?"

I think every new concept in Swift (or any language) should be designed by finding a balance between how the language is actually used by the various parts of the community, and where we (the community and the core team, with more weight on the latter) want the language to be headed towards.

Considering just the former would produce a bloated language with an identity crisis; considering just the latter would alienate some productive users and discard some valid patterns.

People like me, that think class inheritance is a terrible idea at any level and only ever write final classes when needing reference types, really don't have problems (usually) with "interface inheritance" - I gladly design protocol hierarchies - or "storage inheritance" - I'd gladly have inheritance in structs -; the problem is in the override keyword: it's overriding stuff and calling super that constitutes the real can of worms that I avoid.

So why not allow for actors inheritance without allowing for override and super? I suspect that it would simplify actors handling at the compiler level, while also retaining some of the niceties of inheritance.

1 Like