#99 Separator comments

brian Sat 22 Jul 2006

We've been using the following as a "section" separator within a class (out to Col 75):

//////////////////////////////////////////////////////////////////////////
// Construction
//////////////////////////////////////////////////////////////////////////

I tend to use the following terms for key sections which are common:

  • Construction: constructors, factory methods, static lookup methods
  • Identity: core naming, hash, equals, compare
  • Access: access methods
  • Fields: field declarations
  • Debug: methods related to debug sections
  • X Overrides: group of methods being overriden from base class X

Since Fan doesn't allow inner classes, but does allow multiple public classes to be in the same source file I think it will be more common to group lots of classes inside one source file. I propose the following comment separator b/w classes in one source file where X is the class name.

**************************************************************************
** X
**************************************************************************

Do you guys like that convention? Good examples are File.fan, InStream.fan, and Expr.fan (where I collapsed all the Expr subclasses into the same source file).

andy Sat 22 Jul 2006

Yeah, I like that.

Login or Signup to reply.