title: Why is it wrong to use numbers in Java method names?
body: <p>Sometime ago, I remember being told not to use numbers in Java method names. Recently, I had a colleague ask me why and, for the life of me, I could not remember.</p>
  
  <p>According to Sun (and now Oracle) the general naming convention for method names is:</p>
  
  <blockquote>
    <p>Methods should be verbs, in mixed case
    with the first letter lowercase, with
    the first letter of each internal word
    capitalized.</p>
  </blockquote>
  
  <p><a href="http://www.oracle.com/technetwork/java/codeconventions-135099.html#367" rel="noreferrer">Code Conventions of Java</a></p>
  
  <p>This doesn't specifically say that numbers can't be used, although by omission you can see that it's not advised.</p>
  
  <p>Consider the situatiuon (that my colleague has) where you want to perform some logic based on a specific year, for instance, a new policy that takes affect in 2011, and so your application must act on the information and process it based on it's year.  Common sense could tell you that you could call the method:</p>
  
  <pre><code>boolean isSessionPost2011(int id) {}
  </code></pre>
  
  <p>Is it acceptable to use numbers in method names (despite the wording of the standard)? If not, why?</p>
  
  <p><strong>Edit:</strong> "This doesn't specifically say that numbers can't be used, although by omission you can see that it's not advised." Perhaps I worded this incorrectly. The standard says 'Methods should be verbs'. I read this to say that considering a number is not a verb, then method names should not use numbers.</p>