IDEs do a bunch of nice things for you. A lot of people think the nicest is the refactoring support; check out Charles Nutter’s narrative in Part 1 about how it’s helped them in their work on JRuby.
The refactoring I use all the time is renaming, but there are lots more.
Find Usages · IDEs all have a “Find Usages” feature, which in itself is handy (“I’m thinking of nuking this stupid method, where is it used?”) but if you think closely, is also vital too pretty well every other refactoring operation. If you’re going to rename a method or a class or extract an interface, it’s absolutely vital that the IDE know all the places where that code is used; otherwise refactoring equals breakage.
Of course, the problem is harder with dynamic languages, because variables aren’t declared, and because you can screw around with the insides of classes at runtime, and for a bunch of other reasons that Thomas Enebo discusses in Part 2.
Thomas points out that, for refactoring, “open definitions and detecting callers, etc., will only be accurate if you are actually running the code. Which is something you really don’t want your IDE/editor to do”.
Well, I thought about that, and I realized that in fact, my IDE runs my code all the time. Another thing that IDEs make easy is unit testing, and competent programmers take advantage of this and are hitting the “run tests” button every time they change anything, just to make sure they haven’t broken anything.
Unit Testing and Learning · So I wonder about bolting a bunch of apparatus on the side of the unit-test runner. Because when the test is running, if the IDE can peek inside the run-time, it’ll be able to tell exactly which types get assigned to which variables and which method-calls go where.
So I’m thinking of the IDE doing this and then persisting the information, so that whenever you’ve got your cursor on a variable, it has a chance to look at the last test-run cookie crumbs and figure out what that variable contains. The effect would be, the better your unit-testing coverage, the smarter your IDE would be, and the more useful auto-complete would be, and the more refactoring would be possible. Is that a virtuous circle or what?