You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4php-dev@logging.apache.org by Christian Grobmeier <gr...@gmail.com> on 2009/04/30 22:47:44 UTC

Codestyle

Hi
I saw that newer methods hold brackets in the same line as method
signature, while older doesnt.
I am a fan of

method {
}

like Knut seems to be, so can we agree on that codestyle?
I also saw _blub for private variables - i don't need that but can agree to it.

Should we talk about any other agreements before coding more?

Christian

Re: Codestyle

Posted by Knut Urdalen <kn...@php.no>.
Yes, Curt, I agree with you, but currently I want to fix bugs instead of 
"wasting" time on code style ;) We'll clean up the code style later.

I don't have good tools at hand to do this change myself (lack of 
knowledge, I see there is something in Maven, but that's a new tool for 
me an most PHP developers don't know it either) so I will use quite some 
time fixing this, I guess you have better understanding on how to do 
such a change on a complete code base.

Knut

Curt Arnold wrote:
> If you do formatting changes, I'd suggest doing it as an independent 
> commit not intermixed with any functional changes.  I think doing 
> automated processing on the code base and doing it as one fell swoop 
> either at the start of a development cycle or at the end is better 
> than reformatting incrementally.  Best to minimize having formatting 
> changes obscure the functional changes to a code base.


Re: Codestyle

Posted by Knut Urdalen <kn...@php.no>.
Ok, I'll fix the code style this weekend. We only have 54 source files. 
Not hard to fix manually since I have "Convert spaces to tabs" in 
TextMate :)

Knut

Curt Arnold wrote:
> If you do formatting changes, I'd suggest doing it as an independent 
> commit not intermixed with any functional changes.  I think doing 
> automated processing on the code base and doing it as one fell swoop 
> either at the start of a development cycle or at the end is better 
> than reformatting incrementally.  Best to minimize having formatting 
> changes obscure the functional changes to a code base.


Re: Codestyle

Posted by Curt Arnold <ca...@apache.org>.
If you do formatting changes, I'd suggest doing it as an independent  
commit not intermixed with any functional changes.  I think doing  
automated processing on the code base and doing it as one fell swoop  
either at the start of a development cycle or at the end is better  
than reformatting incrementally.  Best to minimize having formatting  
changes obscure the functional changes to a code base.

Re: Codestyle

Posted by Knut Urdalen <kn...@php.no>.
Christian Grobmeier wrote:
> I saw that newer methods hold brackets in the same line as method
> signature, while older doesnt.
> I am a fan of
>
> method {
> }
>
> like Knut seems to be, so can we agree on that codestyle?
>   
Yes, let's use the traditional Unix policy.
> I also saw _blub for private variables - i don't need that but can agree to it.
>   
I never use underscore for private variables, but let's not change it 
unless we are fixing something else. These are details not worth fixing 
until there is something else to fix.
> Should we talk about any other agreements before coding more?
>   
We can talk all day about coding style ;)

However I would like to at least add:
- Let's not do vertical alignment [1] (just because it's ugly and hard 
to maintain 100%), it's used some places in existing code
- Let's use tabs (not spaces) for indenting (most code use spaces now)

Knut

[1] http://en.wikipedia.org/wiki/Programming_style#Vertical_alignment