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 Tiago Espinha <ti...@espinhas.net> on 2011/03/21 22:24:37 UTC
Official stance on tabs
Hi all,
What's our (Derby's) official stance regarding the tab spacing? How strict
are we being with patches? Are we enforcing the 4-spaced tab or are we happy
with the tab-spaced tabs?
I remember when I was a GSoC student I was asked to change my settings in
Eclipse, but I seem to remember have seen patches being committed after that
with just tabs instead of spaces. Do we have an official position on this?
Cheers,
Tiago
Re: Official stance on tabs
Posted by Bryan Pendleton <bp...@gmail.com>.
> That does help. Personally I would like some convention but since plenty of the legacy code doesn't really follow this standard,
> I think I'll be lenient when committing other people's code; especially when it comes to GSoC. Deadlines are usually tight and
> it's probably best not to lose time with cosmetic back and forth of patches.
I think this is a good discussion.
For my part, I think the most important thing is:
fit in with the existing code
When I am working on/with a patch, the patch is usually
a small change to one area of a file, so I generally try
to make the indentation of my patch fit nicely with
the surrounding code. If that file uses hard tabs, I
use hard tabs; if it uses spaces, I use spaces; if it's
already a mix, I just do the best I can to fit in cleanly.
When it comes to committing a contributed patch, I will
often fix up the indentation myself, at the very end,
after all the substantive issues with the patch have
been dealt with. I've noticed that other Derby committers
have done this as well, without any downside that I've noticed.
I also agree that churning through multiple patch revisions
just to tinker with the whitespace isn't very productive.
My observation is that most regular Derby contributors are
sensitive to this already, and generally contribute patches
with few or no unnecessary whitespace diffs, so as a
community we seem to have evolved a practice that works
well enough for now.
Thanks for airing your concerns, and I hope these ideas help!
bryan
Re: Official stance on tabs
Posted by Tiago Espinha <ti...@espinhas.net>.
Hi Rick,
That does help. Personally I would like some convention but since plenty of
the legacy code doesn't really follow this standard, I think I'll be lenient
when committing other people's code; especially when it comes to GSoC.
Deadlines are usually tight and it's probably best not to lose time with
cosmetic back and forth of patches.
Thanks for clearing this for me!
Tiago
2011/3/22 Rick Hillegas <ri...@oracle.com>
> Hi Tiago,
>
> Derby approved a set of coding conventions in August, 2006, mostly to
> satisfy an Apache requirement that projects should establish standards in
> this area:
> http://old.nabble.com/-VOTE---Approve-coding-conventions-for-the-Derby-project-to5771191.html#a5771954The Derby conventions include a large primer published by Sun (now Oracle)
> plus a couple explicit modifications to that primer. I have never seen a
> reviewer even mention, let alone enforce any of the rules in that primer.
> Three of the explicit modifications have earned special mention on the
> checklist for new contributors:
> http://wiki.apache.org/db-derby/DerbyContributorChecklist These hot
> buttons are:
>
> i) A preference for 4-space tabs.
> ii) Elimination of @author tags.
> iii) A preference by some for 80 character lines.
>
> In order to get a submission committed, a new contributor needs to conform
> to the coding philosophy of the committer who reviews the patch. Once in a
> great while, someone will rework an already committed patch to enforce a hot
> button preference. There is little enthusiasm for enforcing the Derby
> conventions systematically. I think this is because:
>
> a) Most of the classes pre-date the adoption of conventions and don't
> conform to them.
> b) Contributors are discouraged from reformatting existing classes in order
> to make them conform to the conventions. This eliminates cosmetic diffs
> which complicate code archaeology.
> c) To promote readability, contributors are encouraged to follow the coding
> style of the class they are working on.
>
> To answer your specific question about tabs: 4-space tab settings are
> preferred but not systematically enforced.
>
> Hope this helps,
> -Rick
>
>
>
>
> On 3/21/11 2:24 PM, Tiago Espinha wrote:
>
>> Hi all,
>>
>> What's our (Derby's) official stance regarding the tab spacing? How strict
>> are we being with patches? Are we enforcing the 4-spaced tab or are we happy
>> with the tab-spaced tabs?
>>
>> I remember when I was a GSoC student I was asked to change my settings in
>> Eclipse, but I seem to remember have seen patches being committed after that
>> with just tabs instead of spaces. Do we have an official position on this?
>>
>> Cheers,
>> Tiago
>>
>
>
Re: Official stance on tabs
Posted by Rick Hillegas <ri...@oracle.com>.
Hi Tiago,
Derby approved a set of coding conventions in August, 2006, mostly to
satisfy an Apache requirement that projects should establish standards
in this area:
http://old.nabble.com/-VOTE---Approve-coding-conventions-for-the-Derby-project-to5771191.html#a5771954
The Derby conventions include a large primer published by Sun (now
Oracle) plus a couple explicit modifications to that primer. I have
never seen a reviewer even mention, let alone enforce any of the rules
in that primer. Three of the explicit modifications have earned special
mention on the checklist for new contributors:
http://wiki.apache.org/db-derby/DerbyContributorChecklist These hot
buttons are:
i) A preference for 4-space tabs.
ii) Elimination of @author tags.
iii) A preference by some for 80 character lines.
In order to get a submission committed, a new contributor needs to
conform to the coding philosophy of the committer who reviews the patch.
Once in a great while, someone will rework an already committed patch to
enforce a hot button preference. There is little enthusiasm for
enforcing the Derby conventions systematically. I think this is because:
a) Most of the classes pre-date the adoption of conventions and don't
conform to them.
b) Contributors are discouraged from reformatting existing classes in
order to make them conform to the conventions. This eliminates cosmetic
diffs which complicate code archaeology.
c) To promote readability, contributors are encouraged to follow the
coding style of the class they are working on.
To answer your specific question about tabs: 4-space tab settings are
preferred but not systematically enforced.
Hope this helps,
-Rick
On 3/21/11 2:24 PM, Tiago Espinha wrote:
> Hi all,
>
> What's our (Derby's) official stance regarding the tab spacing? How
> strict are we being with patches? Are we enforcing the 4-spaced tab or
> are we happy with the tab-spaced tabs?
>
> I remember when I was a GSoC student I was asked to change my settings
> in Eclipse, but I seem to remember have seen patches being committed
> after that with just tabs instead of spaces. Do we have an official
> position on this?
>
> Cheers,
> Tiago