title: Java method naming conventions: Too many getters
body: <p>Why do Java method names use the "get" prefix so extensively? At least in my Java programs there are a lot of methods with names starting with the word "get". The percentage of get-methods is suspiciously high. I am starting to feel that the word "get" is losing its meaning because of inflation. It is noise in my code.</p>
  
  <p>I have noticed that there is a different naming convention being used in functional/declarative programming and PL/SQL. The method name simply states what the method returns. Instead of <code>account.getAmount()</code> or <code>Time.getIsoFormattedDateString(Date date)</code> they will use <code>account.amount()</code> and <code>Time.isoFormattedDateString(Date date)</code>. This makes perfect sense to me, as the name of the function describes the result of evaluating the method (assuming there are no side effects, which there shouldn't be anyway). The "get" prefix seems superfluous.</p>
  
  <p>I have just started reading the book "Clean Code". It says that methods should do only one thing, and that that thing should normally be one of the following:</p>
  
  <ol>
  <li>Notify some object about an event, typically passing the event as a parameter.</li>
  <li>Ask a question about some object, typically with the method name forming a natural language statement, passing the object as parameter and returning a boolean.</li>
  <li>Fetch something, possibly passing some lookup key or some object to be converted as parameter and always returning the desired object/value.</li>
  </ol>
  
  <p>My question is about the third category. Are there naming conventions other than "get" for this kind of methods? What criteria do you use when choosing method names/prefixes?</p>
  
  <p>Here is an example:</p>
  
  <p>I have a class with two methods <code>getDates()</code> and <code>getSpecialDates()</code>. <code>getDates()</code> simply returns the value of a private variable (the reference to a collection of dates). This is a standard getter, as I understand it. <code>getSpecialDates()</code> is different; it calls <code>getDates()</code>, fetches a filter from another class, applies the filter and returns what is effectively a subset of <code>getDates()</code>.</p>
  
  <p>The method getSpecialDates() could be named <code>computeSpecialDates()</code>, <code>findSpecialDates()</code>, <code>selectSpecialDates()</code> or <code>elicitSpecialDates()</code> or whatever. Or I could simply name it <code>specialDates()</code>. And then, for consistency, I could rename <code>getDates()</code> into <code>dates()</code>.</p>
  
  <p>Why bother separating between methods that should be prefixed with "get" and methods that should not, and why bother finding replacement words for "get"?</p>