RBConfigurableFormatter

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|

RBConfigurableFormatter

Travis Griggs-3
I'm just doing a poll. How many people know this exists? How many take the necessary steps to use it? Anyone? Anyone done so and then quit doing so for any good reasons?
--
Travis Griggs
Objologist
"Is success the potential of what could be, or the reality of what is?"


Reply | Threaded
Open this post in threaded view
|

Re: RBConfigurableFormatter

Boris Popov, DeepCove Labs (SNN)
Re: RBConfigurableFormatter

I'm using it all the time. Here its installed during load and you can save/load your settings at will too. I'd be disappointed if it went away without a replacement :)

Cheers!

-Boris
(Sent from a BlackBerry)

----- Original Message -----
From: Travis Griggs <[hidden email]>
To: VW NC <[hidden email]>
Sent: Mon Jan 22 22:57:33 2007
Subject: RBConfigurableFormatter

I'm just doing a poll. How many people know this exists? How many take the necessary steps to use it? Anyone? Anyone done so and then quit doing so for any good reasons?

--
Travis Griggs
Objologist
"Is success the potential of what could be, or the reality of what is?"


Reply | Threaded
Open this post in threaded view
|

Re: RBConfigurableFormatter

Runar Jordahl
In reply to this post by Travis Griggs-3
I use this class for the Epigent Formatter
(http://www.glorp.org/publicRepository/EpigentFormatter.html and
http://www.cincomsmalltalk.com/userblogs/runarj/blogView?showComments=true&title=epigent_formatter&entry=3272276801).

My formatter subclasses RBConfigurableFormatter. It allowed me to
fairly easy make a formatter that resembles the compact formatting
used on VisualAge.

Runar Jordahl

Reply | Threaded
Open this post in threaded view
|

Re: RBConfigurableFormatter

Andre Schnoor
In reply to this post by Travis Griggs-3
I tried to patch resp. extend it to match my personal style some time ago. I didn't succeed to the extent that I'd use it today. So I'm not using it currently.

The worst thing however is: I'm not even using the refactorings anymore that affect source code format, i.e method signature changes etc. I don't want them to mess up my code.

I believe a flexible formatter is absolutely useful. Perhaps I should invest a little more time to implement the style I want.

Andre


Travis Griggs wrote:
I'm just doing a poll. How many people know this exists? How many take the necessary steps to use it? Anyone? Anyone done so and then quit doing so for any good reasons?
--
Travis Griggs
Objologist
"Is success the potential of what could be, or the reality of what is?"


Reply | Threaded
Open this post in threaded view
|

RE: RBConfigurableFormatter

Steven Kelly
In reply to this post by Travis Griggs-3

I'm just doing a poll. How many people know this exists? How many take the necessary steps to use it? Anyone? Anyone done so and then quit doing so for any good reasons?

 

I know it exists, I used it and was impressed by the results (even though I couldn't get exactly what I wanted, the results were much better than the defaults). Next I said "I must really get around to loading and using this regularly", and that of course is as far as I got ;-/

 

Steve

Reply | Threaded
Open this post in threaded view
|

Re: RBConfigurableFormatter

Alan Knight-2
In reply to this post by Travis Griggs-3
I have it in my standard build scripts, although the only things I configure are periods at end of methods and numberOfArgumentsForMultiline:. Some of the parameters I found difficult enough to use properly that I didn't end up using them. I've been meaning to try Runar's formatter for some time, but have gotten about as far as Steven did with the basic one.

At 01:57 AM 1/23/2007, Travis Griggs wrote:
I'm just doing a poll. How many people know this exists? How many take the necessary steps to use it? Anyone? Anyone done so and then quit doing so for any good reasons?
--
Travis Griggs
Objologist
"Is success the potential of what could be, or the reality of what is?"


--
Alan Knight [|], Cincom Smalltalk Development

"The Static Typing Philosophy: Make it fast. Make it right. Make it run." - Niall Ross
Reply | Threaded
Open this post in threaded view
|

Re: RBConfigurableFormatter

Charles A. Monteiro-2
In reply to this post by Travis Griggs-3
I have used it but sort of stop and then go back. The main issue is  
persisting my changes. I don't like saving the image except for at  
strategic points i.e. after doing builds for example. What I have done  
with other tools like the Coding ??? policy (I forget what its called) its  
to persist to a boss file i.e. bypassing relying on saving.


On Tue, 23 Jan 2007 01:57:33 -0500, Travis Griggs <[hidden email]>  
wrote:

> I'm just doing a poll. How many people know this exists? How many
> take the necessary steps to use it? Anyone? Anyone done so and then
> quit doing so for any good reasons?
> --
> Travis Griggs
> Objologist
> "Is success the potential of what could be, or the reality of what is?"
>
>



--
Charles A. Monteiro
http://wiki.nycsmalltalk.org
http://www.monteirosfusion.com
http://monteirofusion.blogspot.com

Reply | Threaded
Open this post in threaded view
|

RE: RBConfigurableFormatter

Paul Baumann
In reply to this post by Travis Griggs-3
 
I tried RBConfigurableFormatter but found the options too limited to get
what I wanted. The main benefit of RBConfigurableFormatter is that it
can be configured in a subclass. I wouldn't want it to go away without a
replacement.

The style I like is much like Runar's formatting but with block ends in
alignment with the beginning of the line that started the block (only
when multi-line of course). Like Alan, I also like periods at the end of
all lines. Having them makes it easier to copy and paste without getting
a MNU error later.  There isn't a thing I like about the default
formatting style, I find it very hard to read and end up double clicking
to find the scope.

For code comparison tools that I write, I compare re-compare while
ignoring style differences to filter out all the junk. For difference
browsers, I give the option to display reformatted code in the panes so
that only true differences are shown. Tool features like these make
personal style differences less of an issue. If I had a formatter that I
liked then I'd change the tools to reformat to a personal style. The
style that code is stored in is of little importance when you have these
features.

Paul Baumann

-----Original Message-----
From: Runar Jordahl [mailto:[hidden email]]
Sent: Tuesday, January 23, 2007 3:20 AM
To: Travis Griggs
Cc: VW NC
Subject: Re: RBConfigurableFormatter

I use this class for the Epigent Formatter
(http://www.glorp.org/publicRepository/EpigentFormatter.html and
http://www.cincomsmalltalk.com/userblogs/runarj/blogView?showComments=tr
ue&title=epigent_formatter&entry=3272276801).

My formatter subclasses RBConfigurableFormatter. It allowed me to fairly
easy make a formatter that resembles the compact formatting used on
VisualAge.

Runar Jordahl
 
 
 
--------------------------------------------------------
This message may contain confidential information and is intended for specific recipients unless explicitly noted otherwise. If you have reason to believe you are not an intended recipient of this message, please delete it and notify the sender. This message may not represent the opinion of IntercontinentalExchange, Inc. (ICE), its subsidiaries or affiliates, and does not constitute a contract or guarantee. Unencrypted electronic mail is not secure and the recipient of this message is expected to provide safeguards from viruses and pursue alternate means of communication where privacy or a binding message is desired.  
 

Reply | Threaded
Open this post in threaded view
|

Re: RBConfigurableFormatter

Charles Adams
In reply to this post by Andre Schnoor
I think Andre hits the nail on the head: if I can't get the formatter to format my code the way I want, then those tools that automatically format the code have an irritating side-effect. And that makes it an impediment to the use of those tools.
 
Plus, no one seems to have the time to dedicate to making a useful configurable formatter. This is one of those things that, on the surface, sounds like an inconsequential or trivial tool to work on. But the fact is that it can be quite useful. One of the many brilliant things my customers have done is to add a step into the code comparison process to reformat the code on both sides of the comparison so that formatting differences are eliminated. Sounds exactly like what Paul B has done.
 
Charles Adams
 
----- Original Message -----
Sent: Tuesday, January 23, 2007 2:56 AM
Subject: Re: RBConfigurableFormatter

I tried to patch resp. extend it to match my personal style some time ago. I didn't succeed to the extent that I'd use it today. So I'm not using it currently.

The worst thing however is: I'm not even using the refactorings anymore that affect source code format, i.e method signature changes etc. I don't want them to mess up my code.

I believe a flexible formatter is absolutely useful. Perhaps I should invest a little more time to implement the style I want.

Andre


Travis Griggs wrote:
I'm just doing a poll. How many people know this exists? How many take the necessary steps to use it? Anyone? Anyone done so and then quit doing so for any good reasons?
--
Travis Griggs
Objologist
"Is success the potential of what could be, or the reality of what is?"


Reply | Threaded
Open this post in threaded view
|

Re: RBConfigurableFormatter

Rick Flower
In reply to this post by Charles A. Monteiro-2
Charles A. Monteiro wrote:
> I have used it but sort of stop and then go back. The main issue is
> persisting my changes. I don't like saving the image except for at
> strategic points i.e. after doing builds for example. What I have done
> with other tools like the Coding ??? policy (I forget what its called)
> its to persist to a boss file i.e. bypassing relying on saving.
I tried it too and did like what it was capable of doing, but at the
time (perhaps 4-5 months ago) it was unable to store the preferences in
an external file which was very handy for me since I occasionally have
to rebuild an image from scratch and don't want to spend time redoing
the formatter prefs.. This might be different now, but at the time that
was the only nit I had.  Otherwise it worked great and was SOO much
better than the default formatter!

Reply | Threaded
Open this post in threaded view
|

Re: RBConfigurableFormatter

Dave Stevenson-2
In reply to this post by Travis Griggs-3
My thoughts from this thread are:
        - we won't find a single format that everyone likes
        - every browser should have the option of displaying source in the
format of choice, regardless of the format in which the source was saved
        - alternative formats should be collected, named and shipped with the
product, beyond the ability to customize individually. For example,
someone mentioned the VisualAge style format, which could be listed as
an option. If Runar's is popular, give it a name and add it to the list
from which users can choose.

Dave

Travis Griggs wrote:
> I'm just doing a poll. How many people know this exists? How many take
> the necessary steps to use it? Anyone? Anyone done so and then quit
> doing so for any good reasons?
> --
> Travis Griggs
> Objologist
> "Is success the potential of what could be, or the reality of what is?"
>
>

Reply | Threaded
Open this post in threaded view
|

Re: RBConfigurableFormatter

Reinout Heeck
In reply to this post by Travis Griggs-3

On Jan 23, 2007, at 7:57 AM, Travis Griggs wrote:

> I'm just doing a poll. How many people know this exists?

Yes, for years now.

> How many take the necessary steps to use it? Anyone? Anyone done so  
> and then quit doing so for any good reasons?

I'm a quitter, I don't recall exactly why but one of the reasons was  
that I couldn't get it to format the way I want it.

I also had a look at AsYouLikeIt, but I don't like that much either,  
I did look into making my own SquareBrackets formatter for it but I  
wanted to base that on the RBConfigurableFormatter, unfortunately  
AsYouLikeIt doesn't support that because RBConfigurableFormatter  
doesn't subclass from the correct base class.

If any redesign is done I want a single *abstract* base class that we  
can base all formatters on. For the formatting that I want to do I  
would really like to have a tree rewriting engine so I can do  
multiple passes over the tree, neither the RBFormatter nor the  
RBConfigurableFormatter provide such an implementation opportunity.

My hunch is also that using subclassing to tweak formatters is the  
wrong way to go, the AsYouLikeIt settings panel already illustrates  
this: I can use ManyDots or FirstLineEmpty but not both at the same  
time.

So I guess formatters should be made parameterizable from the start  
(by making it pluggable or using settings like the  
RBConfigurableFormatter does), regardless of which implementation  
strategy is chosen (single pass visitor or tree-rewriting or whatever)


As for AsYouLikeIt here are two more remarks:

-I would like a config option (or perhaps an extra CodeTool tab) that  
turns auto formatting off.
-It duplicates the code for remembering the current formatter, the RB  
already has that as RBProgramNode class>>FormatterClass


I guess the following course of action would be prudent:

-Move the settings panel from AsYouLikeIt to the base image, and
-provide an abstract superclass for the formatters.

The settings panel needs some effort so that the selected formatter  
can have its parameters changed in the same settings panel. (Or an  
effective cop-out could be to do it as the RBCodeHighlighting does  
it: have a button that opens an external tool, this might make  
persisting the parameters harder though).

The rest can sort itself out over time, whether sponsored by Cincom  
or the community.


Here's a thought I had after writing the above:
for a lot of shops it would help if formatter settings could easily  
be persisted in Store, this seems to be what AsYouLikeIt has as its  
philosophy. But note that in this scenario AsYouLikeIt doesn't model  
formatter settings but formatters as the persistable entity.


Cheers,

R
-

Reply | Threaded
Open this post in threaded view
|

Re: RBConfigurableFormatter

Alan Knight-2
In reply to this post by Rick Flower
At 11:28 AM 1/23/2007, Rick Flower wrote:
Charles A. Monteiro wrote:
I have used it but sort of stop and then go back. The main issue is persisting my changes. I don't like saving the image except for at strategic points i.e. after doing builds for example. What I have done with other tools like the Coding ??? policy (I forget what its called) its to persist to a boss file i.e. bypassing relying on saving.
I tried it too and did like what it was capable of doing, but at the time (perhaps 4-5 months ago) it was unable to store the preferences in an external file which was very handy for me since I occasionally have to rebuild an image from scratch and don't want to spend time redoing the formatter prefs.. This might be different now, but at the time that was the only nit I had.  Otherwise it worked great and was SOO much better than the default formatter!

I just have a set of scripts that configure a development image from a new distribution, and setting the formatter parameters is part of that.

--
Alan Knight [|], Cincom Smalltalk Development

"The Static Typing Philosophy: Make it fast. Make it right. Make it run." - Niall Ross
Reply | Threaded
Open this post in threaded view
|

Re: RBConfigurableFormatter

Rick Flower
Alan Knight wrote:
> I just have a set of scripts that configure a development image from a
> new distribution, and setting the formatter parameters is part of that.
Alan -- You're teasing us (or at least me anyway).. Any chance you'd let
us (or me at least) in on this? I currently do it all by hand and I'll
have to admit that it takes a while to load my 10-15 packages I like to
have added to a vanilla image...  My inquiring mind wants to know
anyway.. (8->

Thanks!

-- Rick

Reply | Threaded
Open this post in threaded view
|

Re: RBConfigurableFormatter

Dave Stevenson-2
Here are my build scripts. I just open the weekly team.im and file in first:
        makeTeam.st
then either of:
        makePackageDev.st
        makeProtoDev.st

Dave

Rick Flower wrote:

> Alan Knight wrote:
>> I just have a set of scripts that configure a development image from a
>> new distribution, and setting the formatter parameters is part of that.
> Alan -- You're teasing us (or at least me anyway).. Any chance you'd let
> us (or me at least) in on this? I currently do it all by hand and I'll
> have to admit that it takes a while to load my 10-15 packages I like to
> have added to a vanilla image...  My inquiring mind wants to know
> anyway.. (8->
>
> Thanks!
>
> -- Rick
>
>

build.zip (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: RBConfigurableFormatter

Dave Stevenson-2
Oh, nevermind. You were probably interested in the formatter part, which
I don't do.

Dave

Dave Stevenson wrote:

> Here are my build scripts. I just open the weekly team.im and file in
> first:
>     makeTeam.st
> then either of:
>     makePackageDev.st
>     makeProtoDev.st
>
> Dave
>
> Rick Flower wrote:
>> Alan Knight wrote:
>>> I just have a set of scripts that configure a development image from
>>> a new distribution, and setting the formatter parameters is part of
>>> that.
>> Alan -- You're teasing us (or at least me anyway).. Any chance you'd
>> let us (or me at least) in on this? I currently do it all by hand and
>> I'll have to admit that it takes a while to load my 10-15 packages I
>> like to have added to a vanilla image...  My inquiring mind wants to
>> know anyway.. (8->
>>
>> Thanks!
>>
>> -- Rick
>>
>>

Reply | Threaded
Open this post in threaded view
|

Re: RBConfigurableFormatter

Travis Griggs-3
In reply to this post by Reinout Heeck
On Jan 23, 2007, at 8:52, Reinout Heeck wrote:

<snip>
I also had a look at AsYouLikeIt, but I don't like that much either, I did look into making my own SquareBrackets formatter for it but I wanted to base that on the RBConfigurableFormatter, unfortunately AsYouLikeIt doesn't support that because RBConfigurableFormatter doesn't subclass from the correct base class.

AsYouLikeIt was a quick hack. It really was for me. I guess I'm rather unique in this regard. I just care so little about the format. What drives me nuts is when it's all different. My brain'll adapt pretty quick to any formatting style, but it doesn't enjoy wasting time constantly adapting. Its got better things to do. But yes, hinging it on RBFormatter was less than desirable.

If any redesign is done I want a single *abstract* base class that we can base all formatters on. For the formatting that I want to do I would really like to have a tree rewriting engine so I can do multiple passes over the tree, neither the RBFormatter nor the RBConfigurableFormatter provide such an implementation opportunity.

Well, this is where this was going. I have some scanner/formatting problems to fix. And I simply don't have the time to do so for two different independent implementations. The point of my query was to find which one. I think I've found that out.

<snip>

--
Travis Griggs
Objologist
"HTTP. It's like a bike pretending to be a bus, a bulldozer, and a cup of coffee at the same time." - Martin Kobetic


Reply | Threaded
Open this post in threaded view
|

Re: RBConfigurableFormatter

Alan Knight-2
In reply to this post by Rick Flower
At 12:14 PM 1/23/2007, Rick Flower wrote:
Alan Knight wrote:
I just have a set of scripts that configure a development image from a new distribution, and setting the formatter parameters is part of that.
Alan -- You're teasing us (or at least me anyway).. Any chance you'd let us (or me at least) in on this? I currently do it all by hand and I'll have to admit that it takes a while to load my 10-15 packages I like to have added to a vanilla image...  My inquiring mind wants to know anyway.. (8->

Well, it's not exactly pretty, but here it is, attached.

I define an environment variable 'ST' that points to my main vw directory, under which I have subdirectories for builds and release. It assumes that it will look for most of these files under $ST/patches, which is where I keep the patches, lists of things to load, and so on.

The prepimage.bat file I put into the image directory and run. It copies visual.im to dev.im, loads a bunch of stuff, and runs some doits, saves the image, and exits. It's windows-specific.

The other files go in the ST directory. There's a settings.cfg that lists the parcels I load by default, and there's a settingsfilein.st that does the file-in stuff. Some of it is stuff I'm testing out, some of it is minor tweaks I do, some of it is setting preferences, loading the repositories that I use, and so on. It's based on scripts originally written by Martin Kobetic, and I've just successively tweaked them. I've included at least some of the relevant files that it loads.
  Package-itemCount just hard-codes that to return 1, because as it stands (or stood last time I looked) that calculation was slow.
  faster-sortForLoading does a different topological sort when loading that's significantly faster. If anyone wants to try that out, I'd appreciate knowing about any bugs.
 windowSpec-initialize sets the default window positioning type to #cascade, and turns sizeAutoSave on. I like it that way.
 


--
Alan Knight [|], Cincom Smalltalk Development
[hidden email]
[hidden email]
http://www.cincom.com/smalltalk

"The Static Typing Philosophy: Make it fast. Make it right. Make it run." - Niall Ross

patches.zip (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: RBConfigurableFormatter

Joseph Bacanskas-4
In reply to this post by Travis Griggs-3
Hi Travis:

I know that it exists.  I've never wanted to use it because I think  
the default looks like Smalltalk.

Perhaps with shorter methods, formatting would become the non-issue  
it ought to be for Smalltalkers.

You may all now burn me at the stake. :-)

On Jan 22, 2007, at 10:57 PM, Travis Griggs wrote:

> I'm just doing a poll. How many people know this exists? How many  
> take the necessary steps to use it? Anyone? Anyone done so and then  
> quit doing so for any good reasons?
> --
> Travis Griggs
> Objologist
> "Is success the potential of what could be, or the reality of what  
> is?"
>
>

Thanks!!
Joseph Bacanskas [|]
--- I use Smalltalk.  My amp goes to eleven.