How important are naming conventions for getters in Java?
问题 I’m a huge believer in consistency, and hence conventions. However, I’m currently developing a framework in Java where these conventions (specifically the get / set prefix convention) seem to get in the way of readability. For example, some classes will have id and name properties and using o.getId() instead of o.id() seems utterly pointless for a number of reasons: The classes are immutable so there will (generally) be no corresponding setter, there is no chance of confusion, the get in this