From: Andre B. <and...@gm...> - 2003-01-04 20:19:32
|
Sven Reichard wrote: >The split temp refactoring is just a prototype, handling the easiest case. >IMO, the correct result would be not to split at all. However, I think it >is not completely trivial to decide if the variable is still used >afterwards (need to check for returns or breaks/continues in the >subscope). >The case above should be added to the test base, and marked as failure. > >Sven. > Well, I just started to read the Refactoring book of M. Fowler and saw that this example is shown there exactly as the SplitTemp-Routines handle it. However I have the feeling and you might agree that the new declaration needs to be placed in the right place to garantuee correct code (btw. Fowler suggest to declare the first variable as constant value). -- Andre |