title: Coding conventions for writing cfc's in CF9?
body: <p>With the new ways of writing CFC in CF9, what are some of the coding convention new to CF9?</p>
  
  <p>Here are some I can think of...</p>
  
  <ul>
  <li>always use LOCAL scope</li>
  <li>always include <code>init()</code> method that returns itself, since <code>New</code> will call init() if found.</li>
  <li>do <strong>not</strong> put required arguments in <code>init()</code> if it is an ORM entity, otherwise expect Exceptions...</li>
  <li>always use <code>THIS.setXXX</code> in where XXX is property name inside init(), so that it will call the implicit setters or custom setter if available.</li>
  <li>abandon the pre-CF8 INSTANCE scope convention, see: <a href="http://henrylearnstorock.blogspot.com/2009/08/should-we-abandon-instance-scope-in-cf9.html" rel="nofollow noreferrer">http://henrylearnstorock.blogspot.com/2009/08/should-we-abandon-instance-scope-in-cf9.html</a></li>
  <li>no output=false for component and functions in script style CFC, see: <a href="http://www.coldfusionjedi.com/index.cfm/2009/8/26/Ask-a-Jedi-Impact-of-whitespace-and-script-based-CFCs" rel="nofollow noreferrer">http://www.coldfusionjedi.com/index.cfm/2009/8/26/Ask-a-Jedi-Impact-of-whitespace-and-script-based-CFCs</a></li>
  <li>use the cleaner and more efficient <code>isNull(arguments.optionalArg)</code> instead of <code>isDefined()</code></li>
  </ul>