[jsword-devel] coding conventions

Manfred Bergmann bergmannmd at web.de
Tue Oct 27 11:10:16 MST 2009

  ----- Original Message ----- 
  From: Joe Walker 
  To: J-Sword Developers Mailing List 
  Sent: Tuesday, October 27, 2009 5:44 PM
  Subject: Re: [jsword-devel] coding conventions

  On Tue, Oct 27, 2009 at 1:09 PM, DM Smith <dmsmith at crosswire.org> wrote:

    On Oct 27, 2009, at 8:32 AM, Manfred Bergmann wrote:

      Hi have a question about conventions.

      Java coding guideline is to have the brackets not in a new line.
      I've seen both in JSword but is it to have new line?

    The JSword guideline is to have every { and } on a new line. This pre-existed my involvement.

  It's my fault.
  My original thought was that { and } on new lines was more readable and that the more compact version only made sense when we were restricted to 80x24. I'm now of the opinion that the above might be true, however uniformity is more important, so I'd now do that the more standard way.

  I also found the { } in new lines better readable in the past.
  Now however my sight about this has changed. Brackets in new line pull too much the attention and distract too much from the code which actually is the more inportant thing.
      Why are the instance variables declarations at the bottom?

    This is another JSword style that was before I came to the project.
    The reasoning is that instance variables are typically private and as such are not something that should be "up front", but rather buried as an implementation detail.
    Class constants should be at the top.

    The general pattern is that constructors should be first, then public methods and classes, protected and package protected methods and classes and finally private methods and classes.

  This is my fault too, and as DM, does, I think I'd defend the practice for the same reasons.

  I see.
  This is a little against the top-down narative pattern.
  But anyway.
  Thanks fro your explanations.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20091027/b616265c/attachment.html>

More information about the jsword-devel mailing list