Re: Coding Standards [was [Quick vote] Coding Standard for Import Statements]

2007-12-22 Thread Stuart McCulloch
On 22/12/2007, Stefano Lenzi <[EMAIL PROTECTED]> wrote:
>
> Carsten Ziegeler wrote:
> > I changed the subject for this general discussions, more comments below.
> >
> > Marcel Offermans wrote:
> >> If you don't mind, I do have a comment about this quick vote.
> > Sure, I don't mind :) - quiet the opposite :)
> >
> >> Let me
> >> start by stating that I think that coding standards are important. In
> >> fact, I was one of the people who pushed for them and came up with the
> >> draft for the first version of the document.
> >>
> >> However, I think the real discussion we should have is about formatting
> >> source code. Do we want to somehow make sure all code is formatted
> >> exactly the same? Does this mean we need to standardize on a single IDE
> >> or a separate formatting tool?
>
> I would like to propose the integration of maven-checkstyle-plugin in
> order main POM so that we can keep an eye on non-complaint sources.
> Furthermore, we can store the checkstyle and formatter configuration in
> our SVN repository, as many projects do.


we use checkstyle over at OPS4J and have our Eclipse formatter config in
svn,
and it's worked out well - using checkstyle is a great way to monitor the
code

Also by exploiting a common
> public location (the SVN repository in this case) containing a set of
> configuration file (both for checksyle and code formatting) we can
> auto-configure IDEs by an ad-hoc tuned POM.
>
> What do you think?


+1 (non-binding)  I'd find this very useful

-- 
Cheers, Stuart


Re: Coding Standards [was [Quick vote] Coding Standard for Import Statements]

2007-12-21 Thread Stefano Lenzi

Carsten Ziegeler wrote:

I changed the subject for this general discussions, more comments below.

Marcel Offermans wrote:
If you don't mind, I do have a comment about this quick vote. 

Sure, I don't mind :) - quiet the opposite :)


Let me
start by stating that I think that coding standards are important. In
fact, I was one of the people who pushed for them and came up with the
draft for the first version of the document.

However, I think the real discussion we should have is about formatting
source code. Do we want to somehow make sure all code is formatted
exactly the same? Does this mean we need to standardize on a single IDE
or a separate formatting tool?


I would like to propose the integration of maven-checkstyle-plugin in 
order main POM so that we can keep an eye on non-complaint sources.
Furthermore, we can store the checkstyle and formatter configuration in 
our SVN repository, as many projects do. Also by exploiting a common 
public location (the SVN repository in this case) containing a set of 
configuration file (both for checksyle and code formatting) we can 
auto-configure IDEs by an ad-hoc tuned POM.


What do you think?



Coding Standards [was [Quick vote] Coding Standard for Import Statements]

2007-12-18 Thread Carsten Ziegeler
I changed the subject for this general discussions, more comments below.

Marcel Offermans wrote:
> 
> If you don't mind, I do have a comment about this quick vote. 
Sure, I don't mind :) - quiet the opposite :)

> Let me
> start by stating that I think that coding standards are important. In
> fact, I was one of the people who pushed for them and came up with the
> draft for the first version of the document.
> 
> However, I think the real discussion we should have is about formatting
> source code. Do we want to somehow make sure all code is formatted
> exactly the same? Does this mean we need to standardize on a single IDE
> or a separate formatting tool?
> 
> I think that is the issue we ran into. You changed some existing code
> and reformatted using your IDE. Richard does not always use Eclipse and
> interprets the current coding standard a bit different from you (and, to
> be honest, Richard's explanation of what's currently in the standard
> seems okay to me, although I must admit the current wording is not that
> exact... perhaps even deliberately ;) ).
Yes, obviously it was my fault as (again) I messed up my settings for
the Felix project in Eclipse (all I wanted to do was to remove an unused
import).

> 
> I don't mind voting on this issue, but my next question would be, are
> you now going to checkout all code, do an "organize imports" on all
> files, and commit that back? This is not only related to organizing
> imports, but to other things mentioned in the coding style too (naming
> of variables, spacing, indentation, ...).
> 
> If we are not going to actively keep formatting code, then we should
> probably pay more attention towards preserving as much as possible the
> style of the existing code. That then means you can never "format" or
> "organize imports" (I use Eclipse lingo here because that's what I use,
> but I'm sure NetBeans, IDEA and even vi have similar concepts).
> 
> Perhaps this is the time to discuss this further and see if we can reach
> some kind of consensus on the issue.
Yes, you're right - this is a general problem. Now, regardless of how
our coding standard might be, I don't think we should go over the whole
source tree and reformat the whole code. However, if people have time to
apply the coding standard for a module or a class or part of a source
file, they of course are welcome to change it. But for a better history,
when applying coding standards no code changes should be made at the
same time.

On the other hand, we are a growing community, and it is inevitably that
people will check in "wrong" formatted code - especially due to all
these nice IDEs doing formatting for you and because each and every
(open source) project uses different coding standards (which makes it
really really hard if you're working on several projects).
We can't force people to commit stuff with the right format - this will
never work; and I don't think we should be that strict, either. So I
think a coding standard is great and helps a lot, but for an open source
project it should be more a guideline than a policy.
If someone "violates" the coding standard we should notify this person
(like we already did in the past - I know this from experience :) ) and
hopefully this person will adapt the code to our coding standard.

Does this make sense?

Carsten
-- 
Carsten Ziegeler
[EMAIL PROTECTED]