If your job is to deliver and maintain such an API, then by allowing subclassing you have a larger contract you have to maintain when you want to make changes to the underlying class: rather than just the public interface, you also need to worry about the protected interface. If your API is new, you may want to shepherd your users (by marking a class as final) to favor composition over inheritance to maximize your ability to evolve the implementation in ways that don't break.
In other words, if you allow subclassing, then you also have to worry about the interface that you have explicitly marked visible to subclasses.
Normally a non-problem, by definition.
final is useful when sealing a class that inherits from a parent class with a protected interface, but even if "final" is reduced to an annotation (or even a comment), its presence explicitly limits your end of the API contract.
EDIT: I'm not sure if it is the case or not; I can't find definitive documentation and I don't have a REPL available. Anyone know for sure?
if you try to set a final field you'll get an exception as expected.
protected members when everything is immutable is pointless. Clojure cleanly separates values and identities.
Except when used to mark the boundary between a stable public API and an internal API that is free to change between releases.
When I release a new major version of Foo Lib, and your program refers to private members, your program will break when I remove or rename them.
Immutability won't protect you from that.
EDIT: Ha, i just stumbled on this old yegge article, which is quite appropriate i think. With clojure APIs you think in verbs, so nouns are not that important
http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom...
EDIT2 : perfect quote :
"In the remotest regions, beyond the Functional Kingdoms, lies a fabled realm called Lambda the Ultimate. In this place it is said that there are no nouns at all, only verbs!"
here you go ;)
I already live in that Kingdom, so when I say "members", I mean member variables or member functions.