Is it just me, or is Java's Override annotation actually useless when programming in a decent IDE?
Yes, I understand that the Override annotation prevents me from accidentally not overriding a super method by misspelling the method name or messing up the method parameters. However, common sense tells me this is very unlikely to happen in modern IDEs, for the following reasons:
- The IDE shows a marker (i.e. a small icon) on the left side of the editor that indicates whether the method is overridden/overriding. Therefore, no explicit Override annotation is needed to show the Override intention.
- If I'm about to rename a method and I see such an override marker, I never, ever edit the method name directly - I instinctively reach out for the keyboard shortcut that opens the IDE's renaming assistant. Likewise, if I intend to change the method signature and I see the override marker, I instinctively use the IDE's method signature assistant instead of doing it by hand (except for very simple cases). Method names and signatures are thus almost always changed correctly, so adding Override annotations becomes (in my opinion) little more than a paranoid and useless safety check - same as spreading 'final' all over the place.
Sure, if you have to write your Java code in Notepad or whatever, the Override annotation obviously helps. But my point is, in a modern IDE, the increase in safety provided by this annotation is not worth the decrease in readability. Any opinions?