Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 'Extract Method" - a suggestion for improvement

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
peterboulton Posted - May 25 2010 : 11:23:31 AM
"Extract Method" is a brilliant options and increasingly useful now I need to go back over existing code and 'parallelize'. However, the way VAX determines which variables/objects need to be passed as arguments to the extracted function seems pretty simplistic.

For example, say the block you are extracting uses a (utility) variable that was declared locally, but outside the selected block for extract method. If the code in the selected block modifies it then surely it may not need to be passed as an argument to the extracted function?

For example, consider the following as part of the selection for method extraction:

// Get target cell
pCell=pRow->GetAt(col);
.. get strCellText for the cells text
pCell->SetText(strCelltext)

In this case, pCell and strCellText need to only be local variables in the extracted method, yet VAX doesn't seem to have any way of identifying them and instead insists on passing them as arguments to the extracted method.

I'd settle for just being able to edit the text in the 'Preview of method signature' on the 'Extract method' dialog box and for the signature to be whatever that box contains when I click 'OK' on the dialog. Or even better, compare the original contents with the revised contents and declare any arguments which were there in the generated signature but manually removed as local variables in the extracted method.

I hope I've explained this clearly - it's very hard sometimes!

Thanks.

Pete
1   L A T E S T    R E P L I E S    (Newest First)
accord Posted - May 25 2010 : 2:31:58 PM
Good idea. I have added a comment to

case=3462

which is about changing the names and the order of the parameters. I've added the idea of delete and explained the reason and the way it should work. I also run into this problem sometimes.

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