Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Re: New Code formatter? Why? (Need a Code Presenter)
Re: New Code formatter? Why? (Need a Code Presenter) [message #105619] Wed, 15 October 2003 17:42 Go to next message
Eclipse UserFriend
Originally posted by: mbrozowski.nc.rr.com

A coworker and I recently started using eclipse and were discussing code
formatting and what
options we could agree on since with both have different styles. We quicky
realized that the optimum
solution would be a code presenter that would show you the code with the
formatting you preferred without change the format of the underlying code.
This would enable individual developers to develop with their own style
without interfering with those of others. Any change the New Formatter
could begin to do things this way?

Matt Brozowski (with input from Mark Miller)
Tavve Software Company
Morrisville, NC



"Alvin Thompson" <nobody@nowhere.com> wrote in message
news:3F8C7EE4.8010901@nowhere.com...
> please remember to use the appropriate newsgroup when posting questions.
> this one probably belongs in 'eclipse.tools.jdt'. it is unlikely you
> will get answers to your questions if you use the wrong newsgroup.
>
> > I am currious why they are bothering re-implementing this when there are
> > already a couple of formatters available and, in fact, potentially the
> > best formatter ever, Jalopy. Wouldnt it make more sense to try to
> > integrate Jalopy more tightly into Eclipse and build on their successes?
>
> jalopy is released under the BSD liscence, while eclipse is released
> under the...ummm...IBM liscence, i think.
>
> also, i want to torture my coworkers' eyes with my bizarre code
> formatting style. see:
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=25559
>
>
> -alvin
>
Re: New Code formatter? Why? (Need a Code Presenter) [message #105961 is a reply to message #105619] Thu, 16 October 2003 09:50 Go to previous messageGo to next message
Jerome Lanneluc is currently offline Jerome LannelucFriend
Messages: 572
Registered: July 2009
Senior Member
That's sound like a nice idea to browse code, but when you make a change to
a .java file and save it, which format would you choose?

Jerome

"Mathew Brozowski" <mbrozowski@nc.rr.com> wrote in message
news:bmk0u3$nt8$1@eclipse.org...
> A coworker and I recently started using eclipse and were discussing code
> formatting and what
> options we could agree on since with both have different styles. We
quicky
> realized that the optimum
> solution would be a code presenter that would show you the code with the
> formatting you preferred without change the format of the underlying code.
> This would enable individual developers to develop with their own style
> without interfering with those of others. Any change the New Formatter
> could begin to do things this way?
>
> Matt Brozowski (with input from Mark Miller)
> Tavve Software Company
> Morrisville, NC
>
>
>
> "Alvin Thompson" <nobody@nowhere.com> wrote in message
> news:3F8C7EE4.8010901@nowhere.com...
> > please remember to use the appropriate newsgroup when posting questions.
> > this one probably belongs in 'eclipse.tools.jdt'. it is unlikely you
> > will get answers to your questions if you use the wrong newsgroup.
> >
> > > I am currious why they are bothering re-implementing this when there
are
> > > already a couple of formatters available and, in fact, potentially the
> > > best formatter ever, Jalopy. Wouldnt it make more sense to try to
> > > integrate Jalopy more tightly into Eclipse and build on their
successes?
> >
> > jalopy is released under the BSD liscence, while eclipse is released
> > under the...ummm...IBM liscence, i think.
> >
> > also, i want to torture my coworkers' eyes with my bizarre code
> > formatting style. see:
> >
> > https://bugs.eclipse.org/bugs/show_bug.cgi?id=25559
> >
> >
> > -alvin
> >
>
>
Re: New Code formatter? Why? (Need a Code Presenter) [message #106040 is a reply to message #105961] Thu, 16 October 2003 10:49 Go to previous messageGo to next message
Jonathan Gossage is currently offline Jonathan GossageFriend
Messages: 42
Registered: July 2009
Member
If you are going to use code presenters you need to establish a normalized
form for storage of your files otherwise you will get many false hits when
merging changes when using an SCM.

Regards

Jonathan Gossage

"Jerome Lanneluc" <jerome_lanneluc@fr.ibm.com> wrote in message
news:bmlpk0$6ir$1@eclipse.org...
> That's sound like a nice idea to browse code, but when you make a change
to
> a .java file and save it, which format would you choose?
>
> Jerome
>
> "Mathew Brozowski" <mbrozowski@nc.rr.com> wrote in message
> news:bmk0u3$nt8$1@eclipse.org...
> > A coworker and I recently started using eclipse and were discussing code
> > formatting and what
> > options we could agree on since with both have different styles. We
> quicky
> > realized that the optimum
> > solution would be a code presenter that would show you the code with the
> > formatting you preferred without change the format of the underlying
code.
> > This would enable individual developers to develop with their own style
> > without interfering with those of others. Any change the New Formatter
> > could begin to do things this way?
> >
> > Matt Brozowski (with input from Mark Miller)
> > Tavve Software Company
> > Morrisville, NC
> >
> >
> >
> > "Alvin Thompson" <nobody@nowhere.com> wrote in message
> > news:3F8C7EE4.8010901@nowhere.com...
> > > please remember to use the appropriate newsgroup when posting
questions.
> > > this one probably belongs in 'eclipse.tools.jdt'. it is unlikely you
> > > will get answers to your questions if you use the wrong newsgroup.
> > >
> > > > I am currious why they are bothering re-implementing this when there
> are
> > > > already a couple of formatters available and, in fact, potentially
the
> > > > best formatter ever, Jalopy. Wouldnt it make more sense to try to
> > > > integrate Jalopy more tightly into Eclipse and build on their
> successes?
> > >
> > > jalopy is released under the BSD liscence, while eclipse is released
> > > under the...ummm...IBM liscence, i think.
> > >
> > > also, i want to torture my coworkers' eyes with my bizarre code
> > > formatting style. see:
> > >
> > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=25559
> > >
> > >
> > > -alvin
> > >
> >
> >
>
>
Re: New Code formatter? Why? (Need a Code Presenter) [message #106052 is a reply to message #105619] Thu, 16 October 2003 11:00 Go to previous messageGo to next message
Sebastian Davids is currently offline Sebastian DavidsFriend
Messages: 69
Registered: July 2009
Member
As far as I know VAJ had a similar feature.

This feature needs two preference page sets to be useful: one for
"presentation" (one's own) and one for Source Control check-in (the team
standard).

If you don't format you code consistently throughout your team you'd
either have a muddle of styles under Source Control or you'll create all
kinds of "false" changes due to each users formatting.

I'd file a feature request in bugzilla.

Sebastian
Re: New Code formatter? Why? (Need a Code Presenter) [message #106131 is a reply to message #106052] Thu, 16 October 2003 12:19 Go to previous messageGo to next message
Eric Clayberg is currently offline Eric ClaybergFriend
Messages: 979
Registered: July 2009
Location: Boston, MA
Senior Member
"Sebastian Davids" <sdavids@gmx.de> wrote in message
news:bmlto8$ao4$1@eclipse.org...
> As far as I know VAJ had a similar feature.

Actually, that was feature added by VA Assist. :-)


http://www.instantiations.com/assist/docs/browser_autoformat _when_viewing.htm

http://www.instantiations.com/assist/docs/browser_autoformat _when_saving.htm

-Eric Clayberg
Sr. Vice President of Product Development
Instantiations, Inc.
mailto:cpsws-support@instantiations.com
http://www.instantiations.com/codepro/ws/
http://www.instantiations.com/assist/
http://www.swt-designer.com
Re: New Code formatter? Why? (Need a Code Presenter) [message #106327 is a reply to message #105961] Thu, 16 October 2003 14:46 Go to previous messageGo to next message
Jean-Christophe Deprez is currently offline Jean-Christophe DeprezFriend
Messages: 133
Registered: July 2009
Senior Member
since it can't save info about the formatting in the compilation unit,
it would have to be in your style or (less likely) some standard style.
we wouldn't be any worse off because that's what we have today. just
reformat the code as it's loaded. if the code is changed it'll have to
be saved in the new format. nice and simple. i like this idea.

-alvin
Re: New Code formatter? Why? (Need a Code Presenter) [message #106341 is a reply to message #106052] Thu, 16 October 2003 15:01 Go to previous messageGo to next message
Jean-Christophe Deprez is currently offline Jean-Christophe DeprezFriend
Messages: 133
Registered: July 2009
Senior Member
excellent point; i suggest that if the file is under the jurisdiction of
a version control system that it be saved in some universal style by
default. that would save a lot of headaches.

-alvin
Re: New Code formatter? Why? (Need a Code Presenter) [message #107171 is a reply to message #106341] Fri, 17 October 2003 19:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ed.burnette.REMOVE.THIS.sas.com

Doesn't help; diffs from my local style to the repository could be
substantial.

What I'd really like to see is a feature where the editor adapts to the
formatting (and tab vs. spaces style!) of the code being edited right now.
For new files, sure, pick your own format. But for a file written 10 years
ago and touched by half a dozen different programmers, I'd like to just
stick with whatever style is being used. People get so uptight about
changing the formatting in 'their' code anyway, so let's preserve it! I want
to be able to check out a file that anyone else formatted and checked in
some time in the past, and run reformat myself, and have nothing happen. Am
I asking too much?

"Alvin Thompson" <nobody@nowhere.com> wrote in message
news:3F8EB2C3.1000701@nowhere.com...
> excellent point; i suggest that if the file is under the jurisdiction of
> a version control system that it be saved in some universal style by
> default. that would save a lot of headaches.
>
> -alvin
>
Re: New Code formatter? Why? (Need a Code Presenter) [message #107226 is a reply to message #107171] Fri, 17 October 2003 21:08 Go to previous messageGo to next message
Jean-Christophe Deprez is currently offline Jean-Christophe DeprezFriend
Messages: 133
Registered: July 2009
Senior Member
how about if before the local version of the code is diff'd with the vcs
version the local version (or a copy) is also formatted to the universal
style? that should work...

-alvin
Re: New Code formatter? Why? (Need a Code Presenter) [message #107317 is a reply to message #107226] Sat, 18 October 2003 09:21 Go to previous messageGo to next message
rich boakes is currently offline rich boakesFriend
Messages: 76
Registered: July 2009
Member
Alvin Thompson wrote:

> how about if before the local version of the code is diff'd with the vcs
> version the local version (or a copy) is also formatted to the universal
> style? that should work...

I think Ed's point is highly relevant to some customers that I've worked
with on a contract basis.

When I've created new source, the customer typically specifies coding
conventions I must adhere to. ('Normalised Form' or 'Team style')

In such cases I'd like to be able to code in my own style and have a
translation process between me and the source repository. (SD called
this "presentation" style, but I think "personal" or "local" might
reflect it's purpose better).

However, I've also worked on much existing source for customers, and
it's rarely been within my remit to reformat it. So I'd want the option
of behaviour that is unchanged from today, where unless I explicitly
format the code, it remains unchanged.

I'm thinking something similar to the Build Path mechanism would be
perfect for this, enabling me to specify through regex, which parts of
the source tree I can and cannot use the translation process on.

To do this really effectively however, I think it would also be
necessary to store the customer's coding style preferences somewhere.

Rich
Re: New Code formatter? Why? (Need a Code Presenter) [message #107940 is a reply to message #105961] Mon, 20 October 2003 17:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mbrozowski.nc.rr.com

We parse the heck out of the file as it is? We even parse the comments now
with Javadoc.

How difficult would it be to make to determine how many spaces of indent the
existing file has and whether they like braces on the same line of the next.
It seems to me the optimimum would be to preserve the formatting of the
existing file so the 'owner/creator' would have it in the format he
originally intended while you could view it in the format you prefer. If
you preserve it as much as possible this makes merging much easier.

Our team started using eclipse here and we all had our own style conventions
which were so different that is mattered to us to standardize. But now the
formatters are rearranging the code making it difficult to merge. We're
having to standardize. Though you could argue that standardizing is good,
that's really only because we don't have a tool that makes it a non issue.

Matt Brozowski

"Jerome Lanneluc" <jerome_lanneluc@fr.ibm.com> wrote in message
news:bmlpk0$6ir$1@eclipse.org...
> That's sound like a nice idea to browse code, but when you make a change
to
> a .java file and save it, which format would you choose?
>
> Jerome
>
> "Mathew Brozowski" <mbrozowski@nc.rr.com> wrote in message
> news:bmk0u3$nt8$1@eclipse.org...
> > A coworker and I recently started using eclipse and were discussing code
> > formatting and what
> > options we could agree on since with both have different styles. We
> quicky
> > realized that the optimum
> > solution would be a code presenter that would show you the code with the
> > formatting you preferred without change the format of the underlying
code.
> > This would enable individual developers to develop with their own style
> > without interfering with those of others. Any change the New Formatter
> > could begin to do things this way?
> >
> > Matt Brozowski (with input from Mark Miller)
> > Tavve Software Company
> > Morrisville, NC
> >
> >
> >
> > "Alvin Thompson" <nobody@nowhere.com> wrote in message
> > news:3F8C7EE4.8010901@nowhere.com...
> > > please remember to use the appropriate newsgroup when posting
questions.
> > > this one probably belongs in 'eclipse.tools.jdt'. it is unlikely you
> > > will get answers to your questions if you use the wrong newsgroup.
> > >
> > > > I am currious why they are bothering re-implementing this when there
> are
> > > > already a couple of formatters available and, in fact, potentially
the
> > > > best formatter ever, Jalopy. Wouldnt it make more sense to try to
> > > > integrate Jalopy more tightly into Eclipse and build on their
> successes?
> > >
> > > jalopy is released under the BSD liscence, while eclipse is released
> > > under the...ummm...IBM liscence, i think.
> > >
> > > also, i want to torture my coworkers' eyes with my bizarre code
> > > formatting style. see:
> > >
> > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=25559
> > >
> > >
> > > -alvin
> > >
> >
> >
>
>
Re: New Code formatter? Why? (Need a Code Presenter) [message #108131 is a reply to message #107940] Tue, 21 October 2003 09:57 Go to previous messageGo to next message
Jerome Lanneluc is currently offline Jerome LannelucFriend
Messages: 572
Registered: July 2009
Senior Member
Another interresting idea. I don't know if this is feasable, how costly it
would be, how much work it would be, etc... But you could still enter a
feature request describing it.

Jerome

"Mathew Brozowski" <mbrozowski@nc.rr.com> wrote in message
news:bn14bq$k5l$1@eclipse.org...
> We parse the heck out of the file as it is? We even parse the comments
now
> with Javadoc.
>
> How difficult would it be to make to determine how many spaces of indent
the
> existing file has and whether they like braces on the same line of the
next.
> It seems to me the optimimum would be to preserve the formatting of the
> existing file so the 'owner/creator' would have it in the format he
> originally intended while you could view it in the format you prefer. If
> you preserve it as much as possible this makes merging much easier.
>
> Our team started using eclipse here and we all had our own style
conventions
> which were so different that is mattered to us to standardize. But now
the
> formatters are rearranging the code making it difficult to merge. We're
> having to standardize. Though you could argue that standardizing is
good,
> that's really only because we don't have a tool that makes it a non issue.
>
> Matt Brozowski
>
> "Jerome Lanneluc" <jerome_lanneluc@fr.ibm.com> wrote in message
> news:bmlpk0$6ir$1@eclipse.org...
> > That's sound like a nice idea to browse code, but when you make a change
> to
> > a .java file and save it, which format would you choose?
> >
> > Jerome
> >
> > "Mathew Brozowski" <mbrozowski@nc.rr.com> wrote in message
> > news:bmk0u3$nt8$1@eclipse.org...
> > > A coworker and I recently started using eclipse and were discussing
code
> > > formatting and what
> > > options we could agree on since with both have different styles. We
> > quicky
> > > realized that the optimum
> > > solution would be a code presenter that would show you the code with
the
> > > formatting you preferred without change the format of the underlying
> code.
> > > This would enable individual developers to develop with their own
style
> > > without interfering with those of others. Any change the New
Formatter
> > > could begin to do things this way?
> > >
> > > Matt Brozowski (with input from Mark Miller)
> > > Tavve Software Company
> > > Morrisville, NC
> > >
> > >
> > >
> > > "Alvin Thompson" <nobody@nowhere.com> wrote in message
> > > news:3F8C7EE4.8010901@nowhere.com...
> > > > please remember to use the appropriate newsgroup when posting
> questions.
> > > > this one probably belongs in 'eclipse.tools.jdt'. it is unlikely you
> > > > will get answers to your questions if you use the wrong newsgroup.
> > > >
> > > > > I am currious why they are bothering re-implementing this when
there
> > are
> > > > > already a couple of formatters available and, in fact, potentially
> the
> > > > > best formatter ever, Jalopy. Wouldnt it make more sense to try to
> > > > > integrate Jalopy more tightly into Eclipse and build on their
> > successes?
> > > >
> > > > jalopy is released under the BSD liscence, while eclipse is released
> > > > under the...ummm...IBM liscence, i think.
> > > >
> > > > also, i want to torture my coworkers' eyes with my bizarre code
> > > > formatting style. see:
> > > >
> > > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=25559
> > > >
> > > >
> > > > -alvin
> > > >
> > >
> > >
> >
> >
>
>
Re: New Code formatter? Why? (Need a Code Presenter) [message #108384 is a reply to message #108131] Tue, 21 October 2003 20:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: derisor.arcor.de

If the backend format was consistent then the front end could be different. The
problem is that when comparing diffs you would NEED to look at the back end
format. If that isnt a compellign block then I dont see why it couldnt be done.
The buffer in the memory can show the code in whatever format it chooses to.

It would be interesting to play with it but I think very low priority.

-- Robert

"Jerome Lanneluc" <jerome_lanneluc@fr.ibm.com> wrote in message
news:bn2vtm$6hu$1@eclipse.org...
> Another interresting idea. I don't know if this is feasable, how costly it
> would be, how much work it would be, etc... But you could still enter a
> feature request describing it.
>
> Jerome
>
> "Mathew Brozowski" <mbrozowski@nc.rr.com> wrote in message
> news:bn14bq$k5l$1@eclipse.org...
> > We parse the heck out of the file as it is? We even parse the comments
> now
> > with Javadoc.
> >
> > How difficult would it be to make to determine how many spaces of indent
> the
> > existing file has and whether they like braces on the same line of the
> next.
> > It seems to me the optimimum would be to preserve the formatting of the
> > existing file so the 'owner/creator' would have it in the format he
> > originally intended while you could view it in the format you prefer. If
> > you preserve it as much as possible this makes merging much easier.
> >
> > Our team started using eclipse here and we all had our own style
> conventions
> > which were so different that is mattered to us to standardize. But now
> the
> > formatters are rearranging the code making it difficult to merge. We're
> > having to standardize. Though you could argue that standardizing is
> good,
> > that's really only because we don't have a tool that makes it a non issue.
> >
> > Matt Brozowski
> >
> > "Jerome Lanneluc" <jerome_lanneluc@fr.ibm.com> wrote in message
> > news:bmlpk0$6ir$1@eclipse.org...
> > > That's sound like a nice idea to browse code, but when you make a change
> > to
> > > a .java file and save it, which format would you choose?
> > >
> > > Jerome
> > >
> > > "Mathew Brozowski" <mbrozowski@nc.rr.com> wrote in message
> > > news:bmk0u3$nt8$1@eclipse.org...
> > > > A coworker and I recently started using eclipse and were discussing
> code
> > > > formatting and what
> > > > options we could agree on since with both have different styles. We
> > > quicky
> > > > realized that the optimum
> > > > solution would be a code presenter that would show you the code with
> the
> > > > formatting you preferred without change the format of the underlying
> > code.
> > > > This would enable individual developers to develop with their own
> style
> > > > without interfering with those of others. Any change the New
> Formatter
> > > > could begin to do things this way?
> > > >
> > > > Matt Brozowski (with input from Mark Miller)
> > > > Tavve Software Company
> > > > Morrisville, NC
> > > >
> > > >
> > > >
> > > > "Alvin Thompson" <nobody@nowhere.com> wrote in message
> > > > news:3F8C7EE4.8010901@nowhere.com...
> > > > > please remember to use the appropriate newsgroup when posting
> > questions.
> > > > > this one probably belongs in 'eclipse.tools.jdt'. it is unlikely you
> > > > > will get answers to your questions if you use the wrong newsgroup.
> > > > >
> > > > > > I am currious why they are bothering re-implementing this when
> there
> > > are
> > > > > > already a couple of formatters available and, in fact, potentially
> > the
> > > > > > best formatter ever, Jalopy. Wouldnt it make more sense to try to
> > > > > > integrate Jalopy more tightly into Eclipse and build on their
> > > successes?
> > > > >
> > > > > jalopy is released under the BSD liscence, while eclipse is released
> > > > > under the...ummm...IBM liscence, i think.
> > > > >
> > > > > also, i want to torture my coworkers' eyes with my bizarre code
> > > > > formatting style. see:
> > > > >
> > > > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=25559
> > > > >
> > > > >
> > > > > -alvin
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Re: New Code formatter? Why? (Need a Code Presenter) [message #110137 is a reply to message #108131] Fri, 24 October 2003 15:11 Go to previous message
Eclipse UserFriend
Originally posted by: ed.burnette.REMOVE.THIS.sas.com

https://bugs.eclipse.org/bugs/show_bug.cgi?id=45512

--
Ed


"Jerome Lanneluc" <jerome_lanneluc@fr.ibm.com> wrote in message
news:bn2vtm$6hu$1@eclipse.org...
> Another interresting idea. I don't know if this is feasable, how costly it
> would be, how much work it would be, etc... But you could still enter a
> feature request describing it.

>
> Jerome
Previous Topic:Eclipse copy of Intellij templates
Next Topic:Can't respond to bugziilla-daemon mails
Goto Forum:
  


Current Time: Tue Jan 14 14:51:21 GMT 2025

Powered by FUDForum. Page generated in 0.04484 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top