Re:Light Table funding successful, including Python support ...
by regularfry on Tuesday June 05, 2012 @05:00AM
(#4067964)
I think I might not have made myself clear - given an execution trace of a test suite with full coverage (or just something which exercises every code path - it doesn't have to be a test suite, but you've already got one of those so you might as well use it, right?), you could build a tool to make a rename refactoring fully automatic in a dynamic language. At the point of use, it would be identical to a static language rename, it would just work in a different way. It's a fairly obvious idea, so I presume this has been done in the past, but I don't know of any examples offhand.
The only gotcha is where you're eval'ing a string, but that's going to be nasty however you cut it.
The analog would be driving to New York from Bangalore. Sure it can be done if I arrange a car; have money for the fuel, food and stay; have all the papers etc etc. But that doesn't mean it is in any way comparable to flying to New York while watching a movie and sipping wine.
Renaming a method in the public interface is always a pain - your test coverage and code tracing can numb down it a bit, but it's going to be there. Some of it is because public interfaces are a constant for all practical intent and purpose; most of it is because of the case I listed above.