You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Jeremy Boynes <jb...@apache.org> on 2005/05/01 21:31:59 UTC

Reformat client code?

Looking through the client code I get the impression that there have 
been a variety of coding styles used over the years.

Does anyone mind if I run this through a code-reformat so that we get 
one style throughout?

[[ in the interest of avoiding a bikeshed discussion I do not want to 
talk about /which/ style to use :-) ]]

--
Jeremy

Re: Reformat client code?

Posted by David Jencks <da...@yahoo.com>.
I think this is a great idea.

david jencks

On May 1, 2005, at 12:31 PM, Jeremy Boynes wrote:

> Looking through the client code I get the impression that there have 
> been a variety of coding styles used over the years.
>
> Does anyone mind if I run this through a code-reformat so that we get 
> one style throughout?
>
> [[ in the interest of avoiding a bikeshed discussion I do not want to 
> talk about /which/ style to use :-) ]]
>
> --
> Jeremy
>


Re: Reformat client code?

Posted by Jeremy Boynes <jb...@apache.org>.
Mike Matrigali wrote:
> I know it is a horrible discussion, but before you reformat all the
> code I would like to know what you are reformatting it to.  I haven't
> used the tool you used, so the settings you posted did not mean much
> to me.
> 

I'd suggest looking at the reformatted client code but its basically the 
  Sun default style with 4 space indent (no tabs) and mandatory braces 
around blocks.

--
Jeremy

Re: Reformat client code?

Posted by Mike Matrigali <mi...@sbcglobal.net>.
I know it is a horrible discussion, but before you reformat all the
code I would like to know what you are reformatting it to.  I haven't
used the tool you used, so the settings you posted did not mean much
to me.

Jeremy Boynes wrote:
> Mamta Satoor wrote:
> 
>> How about if we(Jeremy) format the 10.0 branch too :)
>>
> 
> Easily done if so desired.
> -- 
> Jeremy
> 

Re: Reformat client code?

Posted by Jeremy Boynes <jb...@apache.org>.
Mamta Satoor wrote:
> How about if we(Jeremy) format the 10.0 branch too :)
> 

Easily done if so desired.
--
Jeremy

Re: Reformat client code?

Posted by Mamta Satoor <ms...@gmail.com>.
How about if we(Jeremy) format the 10.0 branch too :)

Mamta

On 5/2/05, Jeremy Boynes <jb...@apache.org> wrote:
> Kathey Marsden wrote:
> >
> > Hey, thanks I think I will take you up on that. It was the patch I sent
> > to the list last week for DERBY-250.
> > Dan said he didn't have any additional issues with it, so I think it is
> > ready to go in.
> >
> 
> OK
> 
> > I  better get my paintbrush fixed up so my patches match our new shed.
> > I am not sure though if I get the  complete story of indentation format
> > etc by reading this file.  I could look at the code and try to figure it
> > out but would feel better if you could just tell us what this means in
> > terms of indentation space/vs tabs etc, so everyone knows how to set up
> > their editor for client coding.  The sad thing is that it looks quite
> > different than the server conventions which use tabs instead of spaces
> > so I guess I need two modes still  #:(
> >
> 
> Tabs suck. OK, I got that off my chest :-)
> 
> The big issue with tabs is that how things indent depend on how tab
> stops are set up in the editor - which everyone sets to 2, 3 or 4 and
> then when you cat something to the terminal (e.g. with a diff) they come
> out as 8 messing everything up. With spaces there is no ambiguity.
> 
> The formatter strips tabs completely and then indents code in 4 space
> chunks as appropriate.
> 
> I would offer to reformat the server as well but am nervous to suggest
> it as it would introduce large cosmetic differences between trunk and
> the 10.0 branch that would make backporting patches difficult. Avoiding
> that with the client codetree was one reason for doing this early.
> 
> --
> Jeremy
>

Re: Reformat client code?

Posted by Mike Matrigali <mi...@sbcglobal.net>.
I agree with the tabs comment, seems like that change alone might
make it easier for everyone to work on the code.   - I don't know about
other code format issues, those may generate more discussion.  At
least with white space, diff tools can be set to ignore.

As you point out
if the change is to made earlier is better - maybe while we are
still in incubator we have the chance, after graduation it will be
harder.

Jeremy Boynes wrote:

> Kathey Marsden wrote:
> 
>>
>> Hey, thanks I think I will take you up on that. It was the patch I sent
>> to the list last week for DERBY-250.
>> Dan said he didn't have any additional issues with it, so I think it is
>> ready to go in.
>>
> 
> OK
> 
>> I  better get my paintbrush fixed up so my patches match our new shed.
>> I am not sure though if I get the  complete story of indentation format
>> etc by reading this file.  I could look at the code and try to figure it
>> out but would feel better if you could just tell us what this means in
>> terms of indentation space/vs tabs etc, so everyone knows how to set up
>> their editor for client coding.  The sad thing is that it looks quite
>> different than the server conventions which use tabs instead of spaces
>> so I guess I need two modes still  #:(
>>
> 
> Tabs suck. OK, I got that off my chest :-)
> 
> The big issue with tabs is that how things indent depend on how tab
> stops are set up in the editor - which everyone sets to 2, 3 or 4 and
> then when you cat something to the terminal (e.g. with a diff) they come
> out as 8 messing everything up. With spaces there is no ambiguity.
> 
> The formatter strips tabs completely and then indents code in 4 space
> chunks as appropriate.
> 
> I would offer to reformat the server as well but am nervous to suggest
> it as it would introduce large cosmetic differences between trunk and
> the 10.0 branch that would make backporting patches difficult. Avoiding
> that with the client codetree was one reason for doing this early.
> 
> -- 
> Jeremy
> 

Re: Reformat client code?

Posted by Jeremy Boynes <jb...@apache.org>.
Kathey Marsden wrote:
> 
> Hey, thanks I think I will take you up on that. It was the patch I sent
> to the list last week for DERBY-250.
> Dan said he didn't have any additional issues with it, so I think it is
> ready to go in.
> 

OK

> I  better get my paintbrush fixed up so my patches match our new shed. 
> I am not sure though if I get the  complete story of indentation format
> etc by reading this file.  I could look at the code and try to figure it
> out but would feel better if you could just tell us what this means in
> terms of indentation space/vs tabs etc, so everyone knows how to set up
> their editor for client coding.  The sad thing is that it looks quite
> different than the server conventions which use tabs instead of spaces
> so I guess I need two modes still  #:(
> 

Tabs suck. OK, I got that off my chest :-)

The big issue with tabs is that how things indent depend on how tab 
stops are set up in the editor - which everyone sets to 2, 3 or 4 and 
then when you cat something to the terminal (e.g. with a diff) they come 
out as 8 messing everything up. With spaces there is no ambiguity.

The formatter strips tabs completely and then indents code in 4 space 
chunks as appropriate.

I would offer to reformat the server as well but am nervous to suggest 
it as it would introduce large cosmetic differences between trunk and 
the 10.0 branch that would make backporting patches difficult. Avoiding 
that with the client codetree was one reason for doing this early.

--
Jeremy

Re: Reformat client code?

Posted by David Jencks <da...@yahoo.com>.
On May 2, 2005, at 2:21 PM, Kathey Marsden wrote:
<snip>
>   The sad thing is that it looks quite
> different than the server conventions which use tabs instead of spaces
>

hmmm... in that case I suggest everyone twist Jeremy's arm to reformat 
the server as well.  My experience with tabs in open source projects is 
that they are a real disaster, whatever other coding conventions may be 
enforced and/or ignored.

thanks
david jencks
>
> Kathey
>
>
>


Re: Reformat client code?

Posted by Kathey Marsden <km...@sbcglobal.net>.
Jeremy Boynes wrote:

>
> I used IntelliJ IDEA with the attached layout template (which is a bit
> heavier than I usually use but I wanted to coerce some of the changes).
>
> Sorry if this messes up your patch - if you want to send it over I
> will do the work of rolling it in.
>   


Hey, thanks I think I will take you up on that. It was the patch I sent
to the list last week for DERBY-250.
Dan said he didn't have any additional issues with it, so I think it is
ready to go in.

I  better get my paintbrush fixed up so my patches match our new shed. 
I am not sure though if I get the  complete story of indentation format
etc by reading this file.  I could look at the code and try to figure it
out but would feel better if you could just tell us what this means in
terms of indentation space/vs tabs etc, so everyone knows how to set up
their editor for client coding.  The sad thing is that it looks quite
different than the server conventions which use tabs instead of spaces
so I guess I need two modes still  #:(

Kathey




Re: Reformat client code?

Posted by Jeremy Boynes <jb...@apache.org>.
Kathey Marsden wrote:
> Jeremy Boynes wrote:
> 
> 
>>Done as of rev 165585.
>>-- 
> 
> 
> Hi Jeremy,
> 
> Could you tell me what you ran it through. I wanted to run the same
> thing on my pending client patch.
> 

I used IntelliJ IDEA with the attached layout template (which is a bit 
heavier than I usually use but I wanted to coerce some of the changes).

Sorry if this messes up your patch - if you want to send it over I will 
do the work of rolling it in.

--
Jeremy

Re: Reformat client code?

Posted by Kathey Marsden <km...@sbcglobal.net>.
Jeremy Boynes wrote:

>
> Done as of rev 165585.
> -- 

Hi Jeremy,

Could you tell me what you ran it through. I wanted to run the same
thing on my pending client patch.

Thanks

Kathey



Re: Reformat client code?

Posted by Jeremy Boynes <jb...@apache.org>.
Jeremy Boynes wrote:
> Looking through the client code I get the impression that there have 
> been a variety of coding styles used over the years.
> 
> Does anyone mind if I run this through a code-reformat so that we get 
> one style throughout?
> 
> [[ in the interest of avoiding a bikeshed discussion I do not want to 
> talk about /which/ style to use :-) ]]
> 

Done as of rev 165585.
--
Jeremy