Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Exctract method parameter order

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
BruteForce Posted - Nov 06 2006 : 08:58:30 AM
Hi,

I am using extract method quite often and it does fairly well. I would like a simple improvement. VA should let me control the order of parameters. This can be done with a simple grid and a pair of up-down buttons.

Ideally the grid should have 3 columns: Order, Variable, New Name. I always prefix my function arguments with a_ (obviously from argument) so an extra column for the final name of the parameter would be just handy and I believe trivial to implement since you already support rename-variable.

Warm Regards,
Dimitris Staikos
5   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Nov 07 2006 : 11:35:11 AM
We do try

On a related front, if you have a solid argument for something it is always worth making your case, since we can be talked round, at least some of the time
BruteForce Posted - Nov 07 2006 : 08:50:39 AM
Thanks Feline!

If everyone else in Whole Tomato is as open minded as you then it's no wonder why VA rocks :-)

Warm Regards,
Dimitris Staikos
feline Posted - Nov 06 2006 : 1:20:11 PM
You make a very valid argument I cannot just agree with every suggestion that is posted, and sometimes it is hard to be sure where to draw the line. I have put in a feature request for this, especially since if done carefully the dialog can be used as before, just enter the method name and press Enter to accept.

case=3462

Change Signature does not change all of the calls. If you think about default parameters, and other edge cases, this is not as easy as it sounds.
BruteForce Posted - Nov 06 2006 : 09:45:09 AM
Thanks for the response, I didn't know that I could reorder the parameters with Change Signature. I trust it reorders the parameters in all calls to the function as well.

I understand your design decision. It's KISS. However allow me to disagree on one thing. An extract method dialog with one or two options to allow reordering the parameters and a checkbox to optionally show an added column with new names for the parameters would be far simpler and straight-forward and possibly less error-prone for the user than dealing with 3 dialogs to run 3 separate refactorings.

It all depends on what you fundamentally define as "extract method". Currently you seem to define "extract method" as "Extract a piece of code into a function whose arguments are in semi-random order and have the same names as the local variables in the original piece of code". For all I know this is what VA does.

I'd rather you defined "extract method" as "Extract a piece of code into a function whose argument names and order are controlled by the user". Personally this is the feature I need.

Warm Regards,
Dimitris Staikos
feline Posted - Nov 06 2006 : 09:04:00 AM
The solution here is to run Extract Method first and then Change Signature on the new function. We have taken the design decision to ask the absolute minimum number of questions during refactoring operations. So all of the refactoring operations are designed to be very "basic", and well suited to being chained together.

Otherwise you end up in the position of having to ask the user 67 questions in a massive wizard every time they want to do something, in order to accommodate all of the different things people want to do

http://www.wholetomato.com/products/features/changeSignature.asp

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000