September 11, 2003
Java refactoring with Eclipse
Eclipse sports a number of automatic refactorings, many of which I use regularly, and some of which I probably ought to use regularly. Refactoring for everyone - How and why to use Eclipse's automated refactoring features is a good intro for anyone who isn't familiar with them.
Is there anything like this for Python? I've not seen anything working. Bicycle Repair Man! doesn't look ready yet.
Posted to Java by Simon Brunning at September 11, 2003 05:23 PM
My theory, for what its worth, is that refactoring is a matter of degrees easier in Python than it is in Java because its not as type restrictive.
For instance, if you want to treat a method's argument as a list rather than a tuple you don't actually have to change the invoking call.
Everything else is a bit tougher because of the very dynamic nature of Python. If you want to rename a method you can find every reference to it at compile time in Java, but in Python it might be so indirectly referenced that you could never pick it up with an introspection tool.
This just reminds us of the Python programmer's motto - unit tests are your friend ;-)
Some forms of refactoring *should* be easier in Python than in Java, it's true. And some are totally uncecessary - 'Use supertype' and 'Extract interface' spring to mind.
But... Eclipse makes everything as easy as falling off a log. Field and method renaming, method and expression extraction, all these and more are a mouse drag and a couple of button clicks away. Eclipse handles much of Java's nastiness for you, so in practice, I find refactoring Java easier than refactoring Python.
Oh, and unit tests are a Java programmers friend too, you know. Don't refactor without them.
teens girls hoodcanalbridge strip centers in florida cumsumitionjunction