> Override functions must use the `override` keyword. Now when you rename the superclass's function, all the subclass functions fail to compile because they're not overriding anything. Why did no one think of this before?
As I understand it, Java has a similar `@Override` annotation:
Java's @Override is not only optional, but fails to address an important use case: when you don't want to override anything with your method, and then the base class has a method added to it with the same name as yours. (Or if you simply didn't know that the base class had that method.) Swift will make sure you don't inadvertently override base class functionality by requiring you to use it.
In Java, you'd just add a 'final' keyword to the base method and you'd get a compile time error if someone accidentally tried to override it.
If you want the equivalent of !@Override, a) you can do it with Java8 annotation types and a checker or b) you can just declare the method private.
I'm sure Swift's version also fails to address all of the edge cases people might want to catch. No type system can be complete and catch every use case.
You can't always do b) since your object has to, well, do something. Personally, I'd like to make inheritance strictly opt-in (as in, classes marked final per default), if anything this may be enough to make some people think twice about the let's-use-inheritance-to-share-code antipattern.
As I understand it, Java has a similar `@Override` annotation:
http://stackoverflow.com/q/94361/49485