Обсуждение: Coding style

Поиск
Список
Период
Сортировка

Coding style

От
"Lars Stenberg"
Дата:
Hi!

I wonder if the project-owner want me to watch the entire jdbc source tree
and convert into a commonly used coding style. In A file i found at least
three different styles:

1) public java.sql.Time getTime(int parameterIndex) throws SQLException
{

2) public java.sql.Timestamp getTimestamp(int parameterIndex)
throws SQLException {

3) public void setUseServerPrepare(boolean flag) throws SQLException {

Might be better if we all use a common codestyle like the third one? Anyhow,
if you want me to fix the code so it is consistent just tell me.

Mvh
Lars Stenberg


Re: Coding style

От
Nic Ferrier
Дата:
"Lars Stenberg" <lars.stenberg@psycat.net> writes:

> Hi!
>
> I wonder if the project-owner want me to watch the entire jdbc source tree
> and convert into a commonly used coding style. In A file i found at least
> three different styles:
>
> 1) public java.sql.Time getTime(int parameterIndex) throws SQLException
> {
>
> 2) public java.sql.Timestamp getTimestamp(int parameterIndex)
> throws SQLException {
>
> 3) public void setUseServerPrepare(boolean flag) throws SQLException {
>
> Might be better if we all use a common codestyle like the third one? Anyhow,
> if you want me to fix the code so it is consistent just tell me.

I'm not one of the project owners... but I do hack on postgresql and I
would rather you didn't do that.

The reason is that doing a text mangle will cause revision tracking
lossage, it's conveiniant sometimes to be able to scan backwards and
forwards across the revision tree.

I believe that postgresql jdbc code IS consistently indented, I for
one don't really care what brace style is used.


Nic

Re: Coding style

От
Bruce Momjian
Дата:
Right.  I do it just before every major release, but don't do it other
times becuase it causes too much of a diff.

---------------------------------------------------------------------------

Nic Ferrier wrote:
> "Lars Stenberg" <lars.stenberg@psycat.net> writes:
>
> > Hi!
> >
> > I wonder if the project-owner want me to watch the entire jdbc source tree
> > and convert into a commonly used coding style. In A file i found at least
> > three different styles:
> >
> > 1) public java.sql.Time getTime(int parameterIndex) throws SQLException
> > {
> >
> > 2) public java.sql.Timestamp getTimestamp(int parameterIndex)
> > throws SQLException {
> >
> > 3) public void setUseServerPrepare(boolean flag) throws SQLException {
> >
> > Might be better if we all use a common codestyle like the third one? Anyhow,
> > if you want me to fix the code so it is consistent just tell me.
>
> I'm not one of the project owners... but I do hack on postgresql and I
> would rather you didn't do that.
>
> The reason is that doing a text mangle will cause revision tracking
> lossage, it's conveiniant sometimes to be able to scan backwards and
> forwards across the revision tree.
>
> I believe that postgresql jdbc code IS consistently indented, I for
> one don't really care what brace style is used.
>
>
> Nic
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: Coding style

От
"Lars Stenberg"
Дата:
Hi!

Just tell me if you need help when you are about to do it.

Mvh
Lars
----- Original Message -----
From: "Bruce Momjian" <pgman@candle.pha.pa.us>
To: "Nic Ferrier" <nferrier@tapsellferrier.co.uk>
Cc: "Lars Stenberg" <lars.stenberg@psycat.net>; <pgsql-jdbc@postgresql.org>
Sent: Monday, February 03, 2003 1:55 AM
Subject: Re: [JDBC] Coding style


>
> Right.  I do it just before every major release, but don't do it other
> times becuase it causes too much of a diff.
>
> --------------------------------------------------------------------------
-
>
> Nic Ferrier wrote:
> > "Lars Stenberg" <lars.stenberg@psycat.net> writes:
> >
> > > Hi!
> > >
> > > I wonder if the project-owner want me to watch the entire jdbc source
tree
> > > and convert into a commonly used coding style. In A file i found at
least
> > > three different styles:
> > >
> > > 1) public java.sql.Time getTime(int parameterIndex) throws
SQLException
> > > {
> > >
> > > 2) public java.sql.Timestamp getTimestamp(int parameterIndex)
> > > throws SQLException {
> > >
> > > 3) public void setUseServerPrepare(boolean flag) throws SQLException {
> > >
> > > Might be better if we all use a common codestyle like the third one?
Anyhow,
> > > if you want me to fix the code so it is consistent just tell me.
> >
> > I'm not one of the project owners... but I do hack on postgresql and I
> > would rather you didn't do that.
> >
> > The reason is that doing a text mangle will cause revision tracking
> > lossage, it's conveiniant sometimes to be able to scan backwards and
> > forwards across the revision tree.
> >
> > I believe that postgresql jdbc code IS consistently indented, I for
> > one don't really care what brace style is used.
> >
> >
> > Nic
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
> >
>
> --
>   Bruce Momjian                        |  http://candle.pha.pa.us
>   pgman@candle.pha.pa.us               |  (610) 359-1001
>   +  If your life is a hard drive,     |  13 Roberts Road
>   +  Christ can be your backup.        |  Newtown Square, Pennsylvania
19073
>


Re: Coding style

От
Bruce Momjian
Дата:
It is in tools/pgindent, called pgjindent.

---------------------------------------------------------------------------

Lars Stenberg wrote:
> Hi!
>
> Just tell me if you need help when you are about to do it.
>
> Mvh
> Lars
> ----- Original Message -----
> From: "Bruce Momjian" <pgman@candle.pha.pa.us>
> To: "Nic Ferrier" <nferrier@tapsellferrier.co.uk>
> Cc: "Lars Stenberg" <lars.stenberg@psycat.net>; <pgsql-jdbc@postgresql.org>
> Sent: Monday, February 03, 2003 1:55 AM
> Subject: Re: [JDBC] Coding style
>
>
> >
> > Right.  I do it just before every major release, but don't do it other
> > times becuase it causes too much of a diff.
> >
> > --------------------------------------------------------------------------
> -
> >
> > Nic Ferrier wrote:
> > > "Lars Stenberg" <lars.stenberg@psycat.net> writes:
> > >
> > > > Hi!
> > > >
> > > > I wonder if the project-owner want me to watch the entire jdbc source
> tree
> > > > and convert into a commonly used coding style. In A file i found at
> least
> > > > three different styles:
> > > >
> > > > 1) public java.sql.Time getTime(int parameterIndex) throws
> SQLException
> > > > {
> > > >
> > > > 2) public java.sql.Timestamp getTimestamp(int parameterIndex)
> > > > throws SQLException {
> > > >
> > > > 3) public void setUseServerPrepare(boolean flag) throws SQLException {
> > > >
> > > > Might be better if we all use a common codestyle like the third one?
> Anyhow,
> > > > if you want me to fix the code so it is consistent just tell me.
> > >
> > > I'm not one of the project owners... but I do hack on postgresql and I
> > > would rather you didn't do that.
> > >
> > > The reason is that doing a text mangle will cause revision tracking
> > > lossage, it's conveiniant sometimes to be able to scan backwards and
> > > forwards across the revision tree.
> > >
> > > I believe that postgresql jdbc code IS consistently indented, I for
> > > one don't really care what brace style is used.
> > >
> > >
> > > Nic
> > >
> > >
> > > ---------------------------(end of broadcast)---------------------------
> > > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
> > >
> >
> > --
> >   Bruce Momjian                        |  http://candle.pha.pa.us
> >   pgman@candle.pha.pa.us               |  (610) 359-1001
> >   +  If your life is a hard drive,     |  13 Roberts Road
> >   +  Christ can be your backup.        |  Newtown Square, Pennsylvania
> 19073
> >
>
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073