I’m sorry, but your comment "Run, don’t walk, from any code developed by
people who think this way [Cedric: people who want everything to be
overridable by default]…" is really appropriate for Smalltalk code, but
wildly out of place for code developed for the JVM, the CLI, or the C++
I disagree with Ted’s firm stance on this issue. While "final" has some
very good niche uses, I contend that most of the code should be written as being
inheritable by default. As a developer, you just can’t guess all the
possible ways that future programmers will use your code. Sure, they could
misuse it and break it, but that’s not your concern. If your API is well
documented (contract, side effects, parameters, etc…) and that a good
developer then tries to extend it, they will come up with things that will
probably amaze you.
That being said, I see "final" as being useful in core classes of the
libraries, such as String. For various reasons (security being one of
them), such fundamental classes need to be free of tampering and extension.
That’s perfectly reasonable.
But for any other type of "user code", please write your code assuming that
one day, someone will want to override the method you are writing. It will
make you see your work in a very different light.