Refactoring

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

Refactoring

Nigel Thorne-3
Hi Guys,
 
I have been using Resharper with C# for a long time and have come to rely on automated refactorings for rapid development. I have been fully aware that refactoring's origins are in the smalltalk community. I am therefore amazed that on first impressions the refactoring support in Squeak doesn't seem to be very extensive. I find this hard to believe, so I must be missing something..
 
I have the refactoring browser installed and use it as my code editor. I have managed to rename classes and methods fine. I found a bug with 'extract local variable' but it mainly seems to work ok. Are there any shortcut key presses I can use rather than reverting to using the mouse to perform each of these refactorings?
 
I feel that smalltalk has the potential to be my all time favorite development language, I just need to get my head around how to fly around the Squeak UI and use it as an IDE.
 
Has anyone got any pointers?
 
please forgive the new-bee questions. If there is a better place to ask these then please let me know.
 
Thanks in advance.
Nigel
 
 
--
Nigel Thorne
Extreme Programmer & Coach
www.nigelthorne.com


Reply | Threaded
Open this post in threaded view
|

Re: Refactoring

stéphane ducasse-2
Hi Nigel,

This is true that the support for refactorings could be better.
In VisualWorks the refactoring engine is integrated and the default  
browser.

Now for 3.9 we are trying to integrate the RB engine everywhere with  
shortcut support
and I strongly believe that Squeak could be much better than the one  
in VisualWorks :) but we
need to people to help.

Stef

> Hi Guys,
>
> I have been using Resharper with C# for a long time and have come  
> to rely on automated refactorings for rapid development. I have  
> been fully aware that refactoring's origins are in the smalltalk  
> community. I am therefore amazed that on first impressions the  
> refactoring support in Squeak doesn't seem to be very extensive. I  
> find this hard to believe, so I must be missing something..
>
> I have the refactoring browser installed and use it as my code  
> editor. I have managed to rename classes and methods fine. I found  
> a bug with 'extract local variable' but it mainly seems to work ok.  
> Are there any shortcut key presses I can use rather than reverting  
> to using the mouse to perform each of these refactorings?
>
> I feel that smalltalk has the potential to be my all time favorite  
> development language, I just need to get my head around how to fly  
> around the Squeak UI and use it as an IDE.
>
> Has anyone got any pointers?
>
> please forgive the new-bee questions. If there is a better place to  
> ask these then please let me know.
>
> Thanks in advance.
> Nigel
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Refactoring

Jason Rogers-4
On 1/19/06, stéphane ducasse <[hidden email]> wrote:

> Hi Nigel,
>
> This is true that the support for refactorings could be better.
> In VisualWorks the refactoring engine is integrated and the default
> browser.
>
> Now for 3.9 we are trying to integrate the RB engine everywhere with
> shortcut support
> and I strongly believe that Squeak could be much better than the one
> in VisualWorks :) but we
> need to people to help.

Another nice-to-have-feature-that-is-way-beyond-me is to have scoped
renaming of a method.  I hate having to rename a method manually and
delete the old named one, then update my code that was using the old
method just because the parent of my class defined a method with the
same selector.

--
Jason Rogers

"I am crucified with Christ..."
    Galatians 2:20

Reply | Threaded
Open this post in threaded view
|

Re: Refactoring

cdavidshaffer
Jason Rogers wrote:

>On 1/19/06, stéphane ducasse <[hidden email]> wrote:
>  
>
>>Hi Nigel,
>>
>>This is true that the support for refactorings could be better.
>>In VisualWorks the refactoring engine is integrated and the default
>>browser.
>>
>>Now for 3.9 we are trying to integrate the RB engine everywhere with
>>shortcut support
>>and I strongly believe that Squeak could be much better than the one
>>in VisualWorks :) but we
>>need to people to help.
>>    
>>
>
>Another nice-to-have-feature-that-is-way-beyond-me is to have scoped
>renaming of a method.  I hate having to rename a method manually and
>delete the old named one, then update my code that was using the old
>method just because the parent of my class defined a method with the
>same selector.
>  
>

Me too.  I keep a workspace script around:

    "Renaming method only in package"
    | pi env |
    pi := PackageOrganizer default packageNamed: 'SomePackage' ifAbsent: [].
    env := BrowserEnvironment new forPackage: pi.
    (RenameMethodRefactoring
        model: (RBNamespace onEnvironment: env)
        renameMethod: #someSelector:
        in: RSContainer
        to: #someOtherSelector:
        permuation: #(1)) execute

for renaming at the package level but a UI would definitely be nice.
The same thing could be done at the class level.

David


Reply | Threaded
Open this post in threaded view
|

Re: Refactoring

johnmci
In reply to this post by Nigel Thorne-3
Well the entire Refactory movement came out of the Smalltalk  
community so yes you are missing something.

There is a saying in the smalltalk community, "Use the source Luke",  
mind in this case you can use the documentation.

http://www.refactory.com/RefactoringBrowser/


PS yes we are also responsible for Agile programming, and Sunits  
perhaps you know of them as JUnits? And hopefully you've looked at  
Seaside?


On 18-Jan-06, at 7:15 PM, Nigel Thorne wrote:

> Hi Guys,
>
> I have been using Resharper with C# for a long time and have come  
> to rely on automated refactorings for rapid development. I have  
> been fully aware that refactoring's origins are in the smalltalk  
> community. I am therefore amazed that on first impressions the  
> refactoring support in Squeak doesn't seem to be very extensive. I  
> find this hard to believe, so I must be missing something..
>
> I have the refactoring browser installed and use it as my code  
> editor. I have managed to rename classes and methods fine. I found  
> a bug with 'extract local variable' but it mainly seems to work ok.  
> Are there any shortcut key presses I can use rather than reverting  
> to using the mouse to perform each of these refactorings?
>
> I feel that smalltalk has the potential to be my all time favorite  
> development language, I just need to get my head around how to fly  
> around the Squeak UI and use it as an IDE.
>
> Has anyone got any pointers?
>
> please forgive the new-bee questions. If there is a better place to  
> ask these then please let me know.
>
> Thanks in advance.
> Nigel
>
>
> --
> Nigel Thorne
> Extreme Programmer & Coach
> www.nigelthorne.com
>

--
========================================================================
===
John M. McIntosh <[hidden email]> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
========================================================================
===


Reply | Threaded
Open this post in threaded view
|

Re: Refactoring

stéphane ducasse-2
In reply to this post by Nigel Thorne-3
By the way nigel
I suggest you to
        have a look at
                - Shout (syntax highliter)
                - eCompletion (great I'm eager to see the integration of  
eCompletion with the typer of roel
                                http://decomp.ulb.ac.be/roelwuyts/smalltalk/roeltyper/
                - Keymapping to change your shortcuts.
                - Monticello to manage your code.

Stef


On 19 janv. 06, at 04:15, Nigel Thorne wrote:

> Hi Guys,
>
> I have been using Resharper with C# for a long time and have come  
> to rely on automated refactorings for rapid development. I have  
> been fully aware that refactoring's origins are in the smalltalk  
> community. I am therefore amazed that on first impressions the  
> refactoring support in Squeak doesn't seem to be very extensive. I  
> find this hard to believe, so I must be missing something..
>
> I have the refactoring browser installed and use it as my code  
> editor. I have managed to rename classes and methods fine. I found  
> a bug with 'extract local variable' but it mainly seems to work ok.  
> Are there any shortcut key presses I can use rather than reverting  
> to using the mouse to perform each of these refactorings?
>
> I feel that smalltalk has the potential to be my all time favorite  
> development language, I just need to get my head around how to fly  
> around the Squeak UI and use it as an IDE.
>
> Has anyone got any pointers?
>
> please forgive the new-bee questions. If there is a better place to  
> ask these then please let me know.
>
> Thanks in advance.
> Nigel
>
>
> --
> Nigel Thorne
> Extreme Programmer & Coach
> www.nigelthorne.com
>


Reply | Threaded
Open this post in threaded view
|

Re: Refactoring

Dave Mason-4
In reply to this post by johnmci
Is the Refactoring Browser the one in SqueakMap?  On the web page
www.refactory.com/RefactoringBrowser it doesn't mention Squeak - just
VisualWorks and VisualAge.  I tried the one from SqueakMap a few months
ago, and it failed (in some way I no longer remember) so I assumed it
was in some beta state.

I'd love to use it if it's robust!

../Dave

Reply | Threaded
Open this post in threaded view
|

Re: Refactoring

Jason Rogers-4
On 1/19/06, Dave Mason <[hidden email]> wrote:
> Is the Refactoring Browser the one in SqueakMap?  On the web page
> www.refactory.com/RefactoringBrowser it doesn't mention Squeak - just
> VisualWorks and VisualAge.  I tried the one from SqueakMap a few months
> ago, and it failed (in some way I no longer remember) so I assumed it
> was in some beta state.
>
> I'd love to use it if it's robust!

Dave, it is surely robust.  There are a few versions of it, so make
sure you are using the correct one from SqueakMap.  RE: the error you
saw a few months ago -- there were some issues installing the
refactoring browser from SqueakMap (I seem to recall it was the String
overhaul) but those are fixed now.  So, you should be able to install
it and start using it today!

--
Jason Rogers

"I am crucified with Christ..."
    Galatians 2:20

Reply | Threaded
Open this post in threaded view
|

Re: Refactoring

stéphane ducasse-2
In reply to this post by Dave Mason-4
> Is the Refactoring Browser the one in SqueakMap?  On the web page
> www.refactory.com/RefactoringBrowser it doesn't mention Squeak - just
> VisualWorks and VisualAge.  I tried the one from SqueakMap a few  
> months
> ago, and it failed (in some way I no longer remember) so I assumed it
> was in some beta state.

the one on squeakmap is a port of the code of John. The port was made  
by daniel
vainsencher and marcus denker if I'm correct.
Coming with the Refactoring Browser is SmallLint (the ui could be  
improve but
the rule engine is really good and can be extended at while). Again  
proposing a better UI
would be really great and would help to get the good tools that are  
available in squeak to shine.

A step in that direction is the new testrunner available in 3.9. It  
makes running the tests 10* faster
and has a much better interface than the old one.

It is working (but may have some glitches but using it and giving  
feedback is the best way
to make it better).

Now the UI is not that great and the recent goal of marcus has been  
to decouple the UI
from the engine and romain is working on introducing via services  
refactoring in the omnibrowser.

So our goal for 3.9 full is to have a good version of OB with RB  
integrated. Note that once
the refactorings will be described via services, any browser querying  
the services will be able to
get the refactorings.

Stef

Reply | Threaded
Open this post in threaded view
|

Re: Refactoring

Chris Muller
In reply to this post by Nigel Thorne-3
Welcome Nigel.  Refactoring activities are functional
but less-polished in Squeak than in commercial tools.
I will have to defer to someone else for keyboard
shortcuts for refactoring.  Overall, I think
*keyboard-only* support in Squeak's UI is poor; you
pretty much have to constantly use the mouse to "fly
around" the IDE.

Having said that, I also should say that where
keyboard support is provided, it is quite superior to
eclipse (don't know about C# tools) in some ways.  For
example, the filtering menu lists allow you to type
your way to the desired selections.

If you are used to eclipse or other windowsy tools
then the Squeak IDE definitely takes some getting used
to.  As someone who has become accustomed to it over
several years, I now find it more efficient than any
commercial tool I've used; mainly because it seems to
do more with less.  For example, compare the number of
gestures to switch the positive-negative conditions of
a if/else blocks vs. Command+e in Squeak.

FYI, for keyboard help, select World menu | help |
command-key help.

I change a couple of the default commands to behave
differently to my taste, this is a good exercise for a
newbie and rewarding in productivity..

Good luck, have fun!
  Chris


> Message: 2
> Date: Thu, 19 Jan 2006 14:15:35 +1100
> From: Nigel Thorne <[hidden email]>
> Subject: Refactoring
> To: [hidden email]
> Message-ID:
>
>
<[hidden email]>

> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi Guys,
>
> I have been using Resharper with C# for a long time
> and have come to rely on
> automated refactorings for rapid development. I have
> been fully aware that
> refactoring's origins are in the smalltalk
> community. I am therefore amazed
> that on first impressions the refactoring support in
> Squeak doesn't seem to
> be very extensive. I find this hard to believe, so I
> must be missing
> something..
>
> I have the refactoring browser installed and use it
> as my code editor. I
> have managed to rename classes and methods fine. I
> found a bug with 'extract
> local variable' but it mainly seems to work ok. Are
> there any shortcut key
> presses I can use rather than reverting to using the
> mouse to perform each
> of these refactorings?
>
> I feel that smalltalk has the potential to be my all
> time favorite
> development language, I just need to get my head
> around how to fly around
> the Squeak UI and use it as an IDE.
>
> Has anyone got any pointers?
>
> please forgive the new-bee questions. If there is a
> better place to ask
> these then please let me know.
>
> Thanks in advance.
> Nigel
>
>
> --
> Nigel Thorne
> Extreme Programmer & Coach
> www.nigelthorne.com