You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Pier Fumagalli <pi...@betaversion.org> on 2003/02/11 04:34:07 UTC

[QUESTION] Coding style...

As in every project where a bunch of people are contributing at the same
time, one day or another, it comes up "what kind" of coding style one
actually want to have throughout the source code...

I was wondering if there are some guidelines for Cocoon (back in the days
when I started there weren't, but maybe now)...

Personally I use "checkstyle" at work (I actually enforced it over there to
have a consistent coding style) and it works all right.
<http://checkstyle.sf.net>

Our coding properties for verification are pretty basic:

  checkstyle.maxlinelen=120
  checkstyle.ignore.braces=true

And instinctively I adopted them also for the HttpProxyGenerator. I was
wondering if it's allright for the others and whether it adheres to the
current ones or not (I wasn't able to figure out if there was a coding
convention throughout the sources)...

What do you guys think?

    Pier


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [QUESTION] Coding style...

Posted by Niclas Hedhman <ni...@hedhman.org>.
On Tuesday 11 February 2003 15:56, Konstantin Piroumian wrote:
> From: "Vadim Gritsenko" <va...@verizon.net>
>
> > Pier Fumagalli wrote:
> > >I was wondering if there are some guidelines for Cocoon (back in the
> > > days when I started there weren't, but maybe now)...
> I am used to the Sun's coding standarts. I have the Guidelines for it on my
> HDD, but don't remember where I got them. They basically state:
>     - 4 space indent
>     - Kernighan-Ritchi style braces (no new line before opening brace):
>         function Name() {
>             //
>         }
>     - 80 character line length (but I think that 17" displays are quite
> common now and the limit can be extended to 120)
>     - variableName - lower case variable names
>     - ClassName - upper case class names

I am using a fairly extensive document as the guide to my staff, with room for 
a fair amount of freedom, AFAIK builds on top of the Sun recommendation.

http://niclas.hedhman.org/docs/guides/javaCodingStandards.pdf

Use this document at your own discretion, it contains a fair amount of advice, 
although some of it you may not like personally.

Niclas

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [QUESTION] Coding style...

Posted by Stephan Michels <st...@apache.org>.
On Tue, 11 Feb 2003, Konstantin Piroumian wrote:

> From: "Vadim Gritsenko" <va...@verizon.net>
> > Pier Fumagalli wrote:
> >
> > >As in every project where a bunch of people are contributing at the same
> > >time, one day or another, it comes up "what kind" of coding style one
> > >actually want to have throughout the source code...
> > >
> > >I was wondering if there are some guidelines for Cocoon (back in the days
> > >when I started there weren't, but maybe now)...
> > >
> > >Personally I use "checkstyle" at work (I actually enforced it over there
> to
> > >have a consistent coding style) and it works all right.
> > ><http://checkstyle.sf.net>
> > >
> > >Our coding properties for verification are pretty basic:
> > >
> > >  checkstyle.maxlinelen=120
> > >  checkstyle.ignore.braces=true
> > >
> > >And instinctively I adopted them also for the HttpProxyGenerator. I was
> > >wondering if it's allright for the others and whether it adheres to the
> > >current ones or not (I wasn't able to figure out if there was a coding
> > >convention throughout the sources)...
> > >
> > >What do you guys think?
> > >
> >
> > I'd like to see 4-spaces-indent, max line length somewhere in 80-100
> > diapason, and the rest does not matter match... You can take (almost)
> > any core class as an example (say, Cocoon.java ;).
>
> I am used to the Sun's coding standarts. I have the Guidelines for it on my
> HDD, but don't remember where I got them. They basically state:
>     - 4 space indent
>     - Kernighan-Ritchi style braces (no new line before opening brace):
>         function Name() {
>             //
>         }
>     - 80 character line length (but I think that 17" displays are quite
> common now and the limit can be extended to 120)
>     - variableName - lower case variable names
>     - ClassName - upper case class names
>
> and a lot of other things.
> You'll find the document here:
> http://cvs.apache.org/~kpiroumian/gdl_sun_java_style.pdf

I currently using JIndent(http://www.jindent.com/), so I wrote
an jindent format file for most used coding style. It works quite well. If
any interest exist I can put it into the repository.

Stephan Michels.


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [QUESTION] Coding style...

Posted by Nicola Ken Barozzi <ni...@apache.org>.

Carsten Ziegeler wrote, On 11/02/2003 9.03:
> We have an informal coding standard that can be seen (as Vadim
> pointed out) in most of our sources; so we should stick to this.

And for the rest we somewhat informall seem to agree to:
http://jakarta.apache.org/poi/resolutions/res001.html
just for the sake of it and write javadocs :-)

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


RE: [QUESTION] Coding style...

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
We have an informal coding standard that can be seen (as Vadim
pointed out) in most of our sources; so we should stick to this.

Carsten

> -----Original Message-----
> From: Konstantin Piroumian [mailto:kpiroumian@apache.org]
> Sent: Tuesday, February 11, 2003 8:56 AM
> To: cocoon-dev@xml.apache.org
> Subject: Re: [QUESTION] Coding style...
>
>
> From: "Vadim Gritsenko" <va...@verizon.net>
> > Pier Fumagalli wrote:
> >
> > >As in every project where a bunch of people are contributing
> at the same
> > >time, one day or another, it comes up "what kind" of coding style one
> > >actually want to have throughout the source code...
> > >
> > >I was wondering if there are some guidelines for Cocoon (back
> in the days
> > >when I started there weren't, but maybe now)...
> > >
> > >Personally I use "checkstyle" at work (I actually enforced it
> over there
> to
> > >have a consistent coding style) and it works all right.
> > ><http://checkstyle.sf.net>
> > >
> > >Our coding properties for verification are pretty basic:
> > >
> > >  checkstyle.maxlinelen=120
> > >  checkstyle.ignore.braces=true
> > >
> > >And instinctively I adopted them also for the HttpProxyGenerator. I was
> > >wondering if it's allright for the others and whether it adheres to the
> > >current ones or not (I wasn't able to figure out if there was a coding
> > >convention throughout the sources)...
> > >
> > >What do you guys think?
> > >
> >
> > I'd like to see 4-spaces-indent, max line length somewhere in 80-100
> > diapason, and the rest does not matter match... You can take (almost)
> > any core class as an example (say, Cocoon.java ;).
>
> I am used to the Sun's coding standarts. I have the Guidelines
> for it on my
> HDD, but don't remember where I got them. They basically state:
>     - 4 space indent
>     - Kernighan-Ritchi style braces (no new line before opening brace):
>         function Name() {
>             //
>         }
>     - 80 character line length (but I think that 17" displays are quite
> common now and the limit can be extended to 120)
>     - variableName - lower case variable names
>     - ClassName - upper case class names
>
> and a lot of other things.
> You'll find the document here:
> http://cvs.apache.org/~kpiroumian/gdl_sun_java_style.pdf
>
> Konstantin
>
> >
> > Vadim
> >
> >
> > >    Pier
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> > For additional commands, email: cocoon-dev-help@xml.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [QUESTION] Coding style...

Posted by Konstantin Piroumian <kp...@apache.org>.
From: "Vadim Gritsenko" <va...@verizon.net>
> Pier Fumagalli wrote:
>
> >As in every project where a bunch of people are contributing at the same
> >time, one day or another, it comes up "what kind" of coding style one
> >actually want to have throughout the source code...
> >
> >I was wondering if there are some guidelines for Cocoon (back in the days
> >when I started there weren't, but maybe now)...
> >
> >Personally I use "checkstyle" at work (I actually enforced it over there
to
> >have a consistent coding style) and it works all right.
> ><http://checkstyle.sf.net>
> >
> >Our coding properties for verification are pretty basic:
> >
> >  checkstyle.maxlinelen=120
> >  checkstyle.ignore.braces=true
> >
> >And instinctively I adopted them also for the HttpProxyGenerator. I was
> >wondering if it's allright for the others and whether it adheres to the
> >current ones or not (I wasn't able to figure out if there was a coding
> >convention throughout the sources)...
> >
> >What do you guys think?
> >
>
> I'd like to see 4-spaces-indent, max line length somewhere in 80-100
> diapason, and the rest does not matter match... You can take (almost)
> any core class as an example (say, Cocoon.java ;).

I am used to the Sun's coding standarts. I have the Guidelines for it on my
HDD, but don't remember where I got them. They basically state:
    - 4 space indent
    - Kernighan-Ritchi style braces (no new line before opening brace):
        function Name() {
            //
        }
    - 80 character line length (but I think that 17" displays are quite
common now and the limit can be extended to 120)
    - variableName - lower case variable names
    - ClassName - upper case class names

and a lot of other things.
You'll find the document here:
http://cvs.apache.org/~kpiroumian/gdl_sun_java_style.pdf

Konstantin

>
> Vadim
>
>
> >    Pier
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [QUESTION] Coding style...

Posted by Vadim Gritsenko <va...@verizon.net>.
Pier Fumagalli wrote:

>As in every project where a bunch of people are contributing at the same
>time, one day or another, it comes up "what kind" of coding style one
>actually want to have throughout the source code...
>
>I was wondering if there are some guidelines for Cocoon (back in the days
>when I started there weren't, but maybe now)...
>
>Personally I use "checkstyle" at work (I actually enforced it over there to
>have a consistent coding style) and it works all right.
><http://checkstyle.sf.net>
>
>Our coding properties for verification are pretty basic:
>
>  checkstyle.maxlinelen=120
>  checkstyle.ignore.braces=true
>
>And instinctively I adopted them also for the HttpProxyGenerator. I was
>wondering if it's allright for the others and whether it adheres to the
>current ones or not (I wasn't able to figure out if there was a coding
>convention throughout the sources)...
>
>What do you guys think?
>

I'd like to see 4-spaces-indent, max line length somewhere in 80-100 
diapason, and the rest does not matter match... You can take (almost) 
any core class as an example (say, Cocoon.java ;).

Vadim


>    Pier
>



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [QUESTION] Coding style...

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Pier Fumagalli wrote:
> As in every project where a bunch of people are contributing at the same
> time, one day or another, it comes up "what kind" of coding style one
> actually want to have throughout the source code...
> 
> I was wondering if there are some guidelines for Cocoon (back in the days
> when I started there weren't, but maybe now)...

The FOP project has some started a Wiki
  http://nagoya.apache.org/wiki/apachewiki.cgi?FOPDevelopersStyleGuide
It is still a bit unsorted. Sun's coding style is the base,
but there are a few other guidelines going beyond the it,
as well as something regarding docs, XML and such.

Everybody who's interested is invited to add to or discuss
this attempt.

> Personally I use "checkstyle" at work
A checkstyle and a reindent (jalopy?) target are most desirable
and should be part of every Apache build file.

J.Pietschmann


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org