What's a good rule of thumb for naming methods that return properties/attributes/members of an object? If an object has some immutable quality "blarg", should a method that returns that quality be called "blarg()" or "getBlarg()"? The Java API, for example, is inconsistent: most properties are accessed through "get" methods (even those that don't have corresponding "set" methods), but yet we also have things like Object.hashCode() instead of Object.getHashCode().
Update: Should whether or not it's the property is a field (in the implementation) be the determiner here? What about a class to represent immutable points in 2-d space? Regardless of whether the point is stored as (x,y) or (r,theta), I would still want accessors for all four properties. Should they be getX(), getY(), etc, or just x(), y(), etc? From the point of view of the user, shouldn't all four have the same naming convention since we don't want our user to know/care about our implementation?