Thread: Source code format vote

Source code format vote

From
Bruce Momjian
Date:
Current votes are:

(8)     8-space tabs:   Tom Lane, Peter E., Massimo, Jan, Hiroshi, Peter M.,                       Michael, Tatsuo
(5)     4-space tabs:   Bruce, Andreas, Vince, Vadim, D'Arcy
            open bracket on if () line:
(7)     yes:    Massimo, Peter, Vince, Tom Lane, Peter M., Marc, Tatsuo  
(6)     no:     Bruce, Vadim, D'Arcy, Jan, Hiroshi, Michael M.


Looks like radical change will come to our source code format for 7.0.

Unless someone else speaks up, I will consider this vote closed.  I will
modify pgindent to reflect this format the next time it is run.

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


Re: [HACKERS] Source code format vote

From
Theo Kramer
Date:
Bruce Momjian wrote:
> 
> Current votes are:
> 
> (8)     8-space tabs:   Tom Lane, Peter E., Massimo, Jan, Hiroshi, Peter M.,
>                         Michael, Tatsuo
> (5)     4-space tabs:   Bruce, Andreas, Vince, Vadim, D'Arcy
> 
> 
>         open bracket on if () line:
> (7)     yes:    Massimo, Peter, Vince, Tom Lane, Peter M., Marc, Tatsuo
> (6)     no:     Bruce, Vadim, D'Arcy, Jan, Hiroshi, Michael M.
> 
> Looks like radical change will come to our source code format for 7.0.
> 
> Unless someone else speaks up, I will consider this vote closed.  I will
> modify pgindent to reflect this format the next time it is run.

Don't know if I qualify to vote - but if I do then I vote for 4-space tabs 
(seeing that I often read the code - now if only two-space tabs 
were an option...)
--------
Regards
Theo


Re: [HACKERS] Source code format vote

From
"J. Roeleveld"
Date:
> > Current votes are:
> >
> > (8)     8-space tabs:   Tom Lane, Peter E., Massimo, Jan, Hiroshi, Peter
M.,
> >                         Michael, Tatsuo
> > (5)     4-space tabs:   Bruce, Andreas, Vince, Vadim, D'Arcy
> >
> >
> >         open bracket on if () line:
> > (7)     yes:    Massimo, Peter, Vince, Tom Lane, Peter M., Marc, Tatsuo
> > (6)     no:     Bruce, Vadim, D'Arcy, Jan, Hiroshi, Michael M.
> >
> > Looks like radical change will come to our source code format for 7.0.
> >
> > Unless someone else speaks up, I will consider this vote closed.  I will
> > modify pgindent to reflect this format the next time it is run.
>
> Don't know if I qualify to vote - but if I do then I vote for 4-space tabs
> (seeing that I often read the code - now if only two-space tabs
> were an option...)

Same here, I prefer 4-space tabs as well, looks much better on standard
screens.
Also I personally prefer the open bracket not to be placed in the if() line.

But I'm not sure if I qualify to vote either, although I do read the code.

Joost Roeleveld



Re: [HACKERS] Source code format vote

From
Stephen Birch
Date:
I would also vote for 4 space tabs.

But would prefer 2 space tabs.

Steve


Theo Kramer wrote:

> Bruce Momjian wrote:
> >
> > Current votes are:
> >
> > (8)     8-space tabs:   Tom Lane, Peter E., Massimo, Jan, Hiroshi, Peter M.,
> >                         Michael, Tatsuo
> > (5)     4-space tabs:   Bruce, Andreas, Vince, Vadim, D'Arcy
> >
> >
> >         open bracket on if () line:
> > (7)     yes:    Massimo, Peter, Vince, Tom Lane, Peter M., Marc, Tatsuo
> > (6)     no:     Bruce, Vadim, D'Arcy, Jan, Hiroshi, Michael M.
> >
> > Looks like radical change will come to our source code format for 7.0.
> >
> > Unless someone else speaks up, I will consider this vote closed.  I will
> > modify pgindent to reflect this format the next time it is run.
>
> Don't know if I qualify to vote - but if I do then I vote for 4-space tabs
> (seeing that I often read the code - now if only two-space tabs
> were an option...)
> --------
> Regards
> Theo
>
> ************



Re: [HACKERS] Source code format vote

From
Tom Lane
Date:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Current votes are:
> (8)     8-space tabs:   Tom Lane, Peter E., Massimo, Jan, Hiroshi, Peter M.,
>                         Michael, Tatsuo
> (5)     4-space tabs:   Bruce, Andreas, Vince, Vadim, D'Arcy

>         open bracket on if () line:
> (7)     yes:    Massimo, Peter, Vince, Tom Lane, Peter M., Marc, Tatsuo  
> (6)     no:     Bruce, Vadim, D'Arcy, Jan, Hiroshi, Michael M.

> Looks like radical change will come to our source code format for 7.0.

It looks to me like there is consensus to change the tab spacing (which
is NOT the same as the logical indent step, for those newcomers who
don't seem to be aware of the difference).

However, I don't see a consensus to change the bracket layout.
7-to-6 is not enough of a margin to justify a wholesale code change.
Especially considering that my original vote was NO, which Bruce chose
to interpret as YES ;-).  Change it back to NO, and the vote is the
other way.

I think what we have is a consensus to change the physical tab spacing
but leave the look of the code alone...
        regards, tom lane


Re: [HACKERS] Source code format vote

From
Bruce Momjian
Date:
Vote is for changing tab size.  Indentation will stay at 4 spaces.


> Bruce Momjian wrote:
> > 
> > Current votes are:
> > 
> > (8)     8-space tabs:   Tom Lane, Peter E., Massimo, Jan, Hiroshi, Peter M.,
> >                         Michael, Tatsuo
> > (5)     4-space tabs:   Bruce, Andreas, Vince, Vadim, D'Arcy
> > 
> > 
> >         open bracket on if () line:
> > (7)     yes:    Massimo, Peter, Vince, Tom Lane, Peter M., Marc, Tatsuo
> > (6)     no:     Bruce, Vadim, D'Arcy, Jan, Hiroshi, Michael M.
> > 
> > Looks like radical change will come to our source code format for 7.0.
> > 
> > Unless someone else speaks up, I will consider this vote closed.  I will
> > modify pgindent to reflect this format the next time it is run.
> 
> Don't know if I qualify to vote - but if I do then I vote for 4-space tabs 
> (seeing that I often read the code - now if only two-space tabs 
> were an option...)
> --------
> Regards
> Theo
> 
> ************
> 


--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


Re: [HACKERS] Source code format vote

From
Bruce Momjian
Date:
Vote is for changing tab size.  Indentation will remain at 4 spaces.


[Charset iso-8859-1 unsupported, filtering to ASCII...]
> > > Current votes are:
> > >
> > > (8)     8-space tabs:   Tom Lane, Peter E., Massimo, Jan, Hiroshi, Peter
> M.,
> > >                         Michael, Tatsuo
> > > (5)     4-space tabs:   Bruce, Andreas, Vince, Vadim, D'Arcy
> > >
> > >
> > >         open bracket on if () line:
> > > (7)     yes:    Massimo, Peter, Vince, Tom Lane, Peter M., Marc, Tatsuo
> > > (6)     no:     Bruce, Vadim, D'Arcy, Jan, Hiroshi, Michael M.
> > >
> > > Looks like radical change will come to our source code format for 7.0.
> > >
> > > Unless someone else speaks up, I will consider this vote closed.  I will
> > > modify pgindent to reflect this format the next time it is run.
> >
> > Don't know if I qualify to vote - but if I do then I vote for 4-space tabs
> > (seeing that I often read the code - now if only two-space tabs
> > were an option...)
> 
> Same here, I prefer 4-space tabs as well, looks much better on standard
> screens.
> Also I personally prefer the open bracket not to be placed in the if() line.
> 
> But I'm not sure if I qualify to vote either, although I do read the code.
> 
> Joost Roeleveld
> 
> 
> ************
> 


--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


Re: [HACKERS] Source code format vote

From
Bruce Momjian
Date:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Current votes are:
> > (8)     8-space tabs:   Tom Lane, Peter E., Massimo, Jan, Hiroshi, Peter M.,
> >                         Michael, Tatsuo
> > (5)     4-space tabs:   Bruce, Andreas, Vince, Vadim, D'Arcy
> 
> >         open bracket on if () line:
> > (7)     yes:    Massimo, Peter, Vince, Tom Lane, Peter M., Marc, Tatsuo  
> > (6)     no:     Bruce, Vadim, D'Arcy, Jan, Hiroshi, Michael M.
> 
> > Looks like radical change will come to our source code format for 7.0.
> 
> It looks to me like there is consensus to change the tab spacing (which
> is NOT the same as the logical indent step, for those newcomers who
> don't seem to be aware of the difference).
> 
> However, I don't see a consensus to change the bracket layout.
> 7-to-6 is not enough of a margin to justify a wholesale code change.
> Especially considering that my original vote was NO, which Bruce chose
> to interpret as YES ;-).  Change it back to NO, and the vote is the
> other way.
> 
> I think what we have is a consensus to change the physical tab spacing
> but leave the look of the code alone...

OK, change tab to 8 spaces, keep indent at 4 spaces, and keep open
bracked on a separate line.  Got it.



--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


Re: [HACKERS] Source code format vote

From
Thomas Lockhart
Date:
> OK, change tab to 8 spaces, keep indent at 4 spaces, and keep open
> bracked on a separate line.  Got it.

Just a couple of comments:

istm that an 8-5 vote should not be interpreted as a "consensus", at
least not until you get those 5 to agree that the proposed change is
acceptable.

Was "spaces instead of tabs" one of the voted-on options? That would
make the tab issue moot, and would result in consistant appearance not
matter what tab setting one is using.
                - Thomas

-- 
Thomas Lockhart                lockhart@alumni.caltech.edu
South Pasadena, California


Re: [HACKERS] Source code format vote

From
Tom Lane
Date:
Thomas Lockhart <lockhart@alumni.caltech.edu> writes:
> Was "spaces instead of tabs" one of the voted-on options? That would
> make the tab issue moot, and would result in consistant appearance not
> matter what tab setting one is using.

Quite a good thought, actually.  It'd be worth checking to see if there
is any material expansion in the source's disk footprint and/or the
size of a compressed tarball after getting rid of tabs entirely.
I'd be willing to vote for this if the space penalty is not large...
        regards, tom lane


Re: [HACKERS] Source code format vote

From
Hannu Krosing
Date:
Tom Lane wrote:
> 
> Thomas Lockhart <lockhart@alumni.caltech.edu> writes:
> > Was "spaces instead of tabs" one of the voted-on options? That would
> > make the tab issue moot, and would result in consistant appearance not
> > matter what tab setting one is using.
> 
> Quite a good thought, actually.  It'd be worth checking to see if there
> is any material expansion in the source's disk footprint and/or the
> size of a compressed tarball after getting rid of tabs entirely.
> I'd be willing to vote for this if the space penalty is not large...

Me too!

And, there already is an utility to entab/detab in tools section, so people
can use it if they absolutely must have tabs in their source.

AFAIK most decent editors also can [en/de]tab the source they are editing.

So my vote would be 4-space indents, no tabs

--------------
Hannu


Re: [HACKERS] Source code format vote

From
Jan Wieck
Date:
Hannu Krosing wrote:

> Tom Lane wrote:
> >
> > Thomas Lockhart <lockhart@alumni.caltech.edu> writes:
> > > Was "spaces instead of tabs" one of the voted-on options? That would
> > > make the tab issue moot, and would result in consistant appearance not
> > > matter what tab setting one is using.
> >
> > I'd be willing to vote for this if the space penalty is not large...
>
> Me too!
    Count me in.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#========================================= wieck@debis.com (Jan Wieck) #





Re: [HACKERS] Source code format vote

From
Bruce Momjian
Date:
> Hannu Krosing wrote:
> 
> > Tom Lane wrote:
> > >
> > > Thomas Lockhart <lockhart@alumni.caltech.edu> writes:
> > > > Was "spaces instead of tabs" one of the voted-on options? That would
> > > > make the tab issue moot, and would result in consistant appearance not
> > > > matter what tab setting one is using.
> > >
> > > I'd be willing to vote for this if the space penalty is not large...
> >
> > Me too!
> 
>      Count me in.

Do I need to tabluate a vote on this too?

I have to get all new votes from everyone on:8-space tabsno tabs

Indentaion is still 4-spaces.

I prefer the 8-space tabs to no tabs.  Seems like 8-space tabs won over
4-space tabs, so we need a vote on 8-space tabs vs. no tabs.

I will need new votes because I have not kept any of the old messages.

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


Re: [HACKERS] Source code format vote

From
Vince Vielhaber
Date:
On 03-Jan-00 Bruce Momjian wrote:
>> Hannu Krosing wrote:
>> 
>> > Tom Lane wrote:
>> > >
>> > > Thomas Lockhart <lockhart@alumni.caltech.edu> writes:
>> > > > Was "spaces instead of tabs" one of the voted-on options? That would
>> > > > make the tab issue moot, and would result in consistant appearance not
>> > > > matter what tab setting one is using.
>> > >
>> > > I'd be willing to vote for this if the space penalty is not large...
>> >
>> > Me too!
>> 
>>      Count me in.
> 
> Do I need to tabluate a vote on this too?
> 
> I have to get all new votes from everyone on:
>       
>       8-space tabs
>       no tabs
> 
> Indentaion is still 4-spaces.
> 
> I prefer the 8-space tabs to no tabs.  Seems like 8-space tabs won over
> 4-space tabs, so we need a vote on 8-space tabs vs. no tabs.
> 
> I will need new votes because I have not kept any of the old messages.

Ok, this is probably a really dumb question and probably even been answered
before but I missed it.  Why not make a tab be a tab and however it appears
in the end programmer's editor can be up to the programmer?  Or is pgindent
changing tabs to spaces?

Vince.
-- 
==========================================================================
Vince Vielhaber -- KA8CSH    email: vev@michvhf.com    http://www.pop4.net  128K ISDN: $24.95/mo or less - 56K Dialup:
$17.95/moor less at Pop4       Online Campground Directory    http://www.camping-usa.com      Online Giftshop
Superstore   http://www.cloudninegifts.com
 
==========================================================================




Re: [HACKERS] Source code format vote

From
The Hermit Hacker
Date:
I'm for no-tabs personally ...


On Mon, 3 Jan 2000, Bruce Momjian wrote:

> > Hannu Krosing wrote:
> > 
> > > Tom Lane wrote:
> > > >
> > > > Thomas Lockhart <lockhart@alumni.caltech.edu> writes:
> > > > > Was "spaces instead of tabs" one of the voted-on options? That would
> > > > > make the tab issue moot, and would result in consistant appearance not
> > > > > matter what tab setting one is using.
> > > >
> > > > I'd be willing to vote for this if the space penalty is not large...
> > >
> > > Me too!
> > 
> >      Count me in.
> 
> Do I need to tabluate a vote on this too?
> 
> I have to get all new votes from everyone on:
>     
>     8-space tabs
>     no tabs
> 
> Indentaion is still 4-spaces.
> 
> I prefer the 8-space tabs to no tabs.  Seems like 8-space tabs won over
> 4-space tabs, so we need a vote on 8-space tabs vs. no tabs.
> 
> I will need new votes because I have not kept any of the old messages.
> 
> -- 
>   Bruce Momjian                        |  http://www.op.net/~candle
>   maillist@candle.pha.pa.us            |  (610) 853-3000
>   +  If your life is a hard drive,     |  830 Blythe Avenue
>   +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
> 
> ************
> 

Marc G. Fournier                   ICQ#7615664               IRC Nick: Scrappy
Systems Administrator @ hub.org 
primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org 



Re: [HACKERS] Source code format vote

From
darcy@druid.net (D'Arcy J.M. Cain)
Date:
Thus spake Bruce Momjian
> I have to get all new votes from everyone on:
>     
>     8-space tabs
>     no tabs
> 
> Indentaion is still 4-spaces.
> 
> I prefer the 8-space tabs to no tabs.  Seems like 8-space tabs won over
> 4-space tabs, so we need a vote on 8-space tabs vs. no tabs.

Seems like multiple votes.  First vote is whether to use spaces or tabs
for indenting.  Then, how many characters should we indent if we use
tabs and if we don't.  Note that people may have different opinions
on how much to indent for each of these.  I suspect a number of people
choose 8 space tabs because it is standard and consistent on different
methods of output, not because they particularly like that much
indentation.  I know that I have lately been considering going to 3
space, no tab indenting in my own code so that it looks right whether
I use the editor, cat to the screen or print it.

-- 
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.


Re: [HACKERS] Source code format vote

From
darcy@druid.net (D'Arcy J.M. Cain)
Date:
Thus spake Vince Vielhaber
> Ok, this is probably a really dumb question and probably even been answered
> before but I missed it.  Why not make a tab be a tab and however it appears
> in the end programmer's editor can be up to the programmer?  Or is pgindent
> changing tabs to spaces?

Not a dumb question at all.  However, think about comments.  Look at
this example.
i++;    /* This variable is being incremented.  I am commenting *         * this because it is such a stupid variable
name        */
 

Under my editor that comment lines up nicely but it will look cockeyed
for many people reading this because I used tabs instead of spaces and
my tabs are 4, not the usual 8.

-- 
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.


Re: [HACKERS] Source code format vote

From
The Hermit Hacker
Date:
On Mon, 3 Jan 2000, D'Arcy J.M. Cain wrote:

> Thus spake Bruce Momjian
> > I have to get all new votes from everyone on:
> >     
> >     8-space tabs
> >     no tabs
> > 
> > Indentaion is still 4-spaces.
> > 
> > I prefer the 8-space tabs to no tabs.  Seems like 8-space tabs won over
> > 4-space tabs, so we need a vote on 8-space tabs vs. no tabs.
> 
> Seems like multiple votes.  First vote is whether to use spaces or tabs
> for indenting.  Then, how many characters should we indent if we use
> tabs and if we don't.  Note that people may have different opinions
> on how much to indent for each of these.  I suspect a number of people
> choose 8 space tabs because it is standard and consistent on different
> methods of output, not because they particularly like that much
> indentation.  I know that I have lately been considering going to 3
> space, no tab indenting in my own code so that it looks right whether
> I use the editor, cat to the screen or print it.

I tend to prefer 2 spaces to using tabs myself ...

Marc G. Fournier                   ICQ#7615664               IRC Nick: Scrappy
Systems Administrator @ hub.org 
primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org 



Re: [HACKERS] Source code format vote

From
darcy@druid.net (D'Arcy J.M. Cain)
Date:
Thus spake The Hermit Hacker
> I tend to prefer 2 spaces to using tabs myself ...

Two seems a little too small to me although I have been considering
three for some time.

-- 
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.


Re: [HACKERS] Source code format vote

From
Bruce Momjian
Date:
> Thus spake The Hermit Hacker
> > I tend to prefer 2 spaces to using tabs myself ...
> 
> Two seems a little too small to me although I have been considering
> three for some time.

Four is a nice 1/2 multiple of 8, the standard tab size.

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


Re: [HACKERS] Source code format vote

From
Vince Vielhaber
Date:
On Mon, 3 Jan 2000, D'Arcy J.M. Cain wrote:

> Thus spake Vince Vielhaber
> > Ok, this is probably a really dumb question and probably even been answered
> > before but I missed it.  Why not make a tab be a tab and however it appears
> > in the end programmer's editor can be up to the programmer?  Or is pgindent
> > changing tabs to spaces?
> 
> Not a dumb question at all.  However, think about comments.  Look at
> this example.
> 
>     i++;    /* This variable is being incremented.  I am commenting *
>              * this because it is such a stupid variable name
>              */
> 
> Under my editor that comment lines up nicely but it will look cockeyed
> for many people reading this because I used tabs instead of spaces and
> my tabs are 4, not the usual 8.

Good point.  I'm looking at it in pine right now and it's not too well
lined up.

Vince.
-- 
==========================================================================
Vince Vielhaber -- KA8CSH    email: vev@michvhf.com    http://www.pop4.net  128K ISDN: $24.95/mo or less - 56K Dialup:
$17.95/moor less at Pop4       Online Campground Directory    http://www.camping-usa.com      Online Giftshop
Superstore   http://www.cloudninegifts.com
 
==========================================================================