title: determining which verb to use for method names in Java
body: <p>I understand that naming conventions are important for a number of reasons, most having to do with making your code more readable and easier to integrate into larger projects, etc. In Java, most conventions require that method names be in <code>lowerCamelCase</code> begin with a verb.</p>
  
  <p>My question is: how do I choose the verb to begin the method name?</p>
  
  <p>To make this question less vague, I'm often in the situation where my first choice for a method name is a noun describing the output. In these cases, I'm usually torn between appending generic verbs such as <code>get</code>, <code>generate</code>, <code>calculate</code>, etc in font of the noun to conform to the verb rule. Are there general guidelines for when to use which?</p>
  
  <p>Here's an example. I have a method that takes <code>double[] array</code> and an <code>int k</code> and returns <code>double[] newArray</code> which is the length <code>k</code> moving average of <code>array</code>, i.e. <code>newArray[i] = (array[i-k+1]+...+array[i])/k</code> with some fudging to make <code>newArray</code> the same length as <code>array</code>. My inclination is to call this method <code>movingAverage</code> since that's what it returns, but that's out since it doesn't begin with a verb. Should I call this method <code>getMovingAverage</code> or <code>generateMovingAverage</code> or <code>calculateMovingAverage</code> or does it not really matter?</p>