Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Extract method replacing duplicated code?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

GennadiyKorol
Ketchup Master

Israel
54 Posts

Posted - Sep 12 2008 :  4:36:19 PM  Show Profile  Reply with Quote
Sometimes when using extract method we already have an almost identical version of the code for the same function somewhere else in the current source file

Simple example:

if (!resource.isReleased() ) {
resource.release();
}


At some point you might want to put this into a method:

void releaseResources()

But at that point you already have those 3 lines of code in multiple places of your file.

It would be nice if VAX would provide a list of "similar" places in your code that can match this procedure and suggest to replace them as well.

Correctness might be a theoretical concept but incorrectness has practical implications.

Edited by - GennadiyKorol on Sep 12 2008 4:36:56 PM

feline
Whole Tomato Software

United Kingdom
18995 Posts

Posted - Sep 16 2008 :  07:48:34 AM  Show Profile  Reply with Quote
We are considering having Extract Method search for other instances of the extracted code in the current function, so scanning the whole file is a logical extension:

case=4313

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000