Recently, I was doing some refactoring with a C# team. We were moving along well, but there were some annoyances. One of them was the back and forth navigation that we had to do whenever we choose to extract a method: Make the method abstract in a base class and then override it in a derived class. It was a series of refactoring steps that the available C# refactoring tool couldn’t deal with, and it was bit harder than it would’ve been if we were using Java.
Why?
Well, the problem was the override/virtual syntax in C#. When you have a method that you’d like to override, you have to go to it, make it virtual and then go to the overrides and explicitly mark them with the override keyword.
The thing is, I know why they designed .NET this way. Microsoft has always tried to enable clean incremental deployment of software. It’s been a concern for them from the beginning. COM was designed specifically to allow incremental deployment and MFC was written the way it was to avoid the fragile base class problem.
So I understand that Microsoft wanted to make redeployment of base classes safer, but, really, I wish that I didn’t have to retype and adjust declarations to do it. The IDE should help more.
A year or so ago, I met up with Ivan Moore and he was talking about a tool he wanted to write for Java. What it would do is load up a set of classes and add private to the declaration of every field and method that could be private. It was a cool idea, and he had a very cool name for it: Thatcher (it privatizes things).
Some friends and I were talking to him about it and although many of us agreed that it would be a great tool to have, a few of us were a bit apprehensive. We’d been burned by frameworks that were overly restrictive and we felt that if private were a tool-generated default, it could be misused rather badly.
As we spoke, we had another idea. What if your IDE did the analysis for you, and visually marked every field and method that that was not used outside the class? Would that be enough?
Yes, there are a lot of things to think about. One is the scope of analysis. Another is social effect of replacing prohibition with information. But, in general, I don’t think we make our IDEs do enough of this work. It would be great to have a Haskell editor that derives and shows you the type signature of a function, or a C++ IDE that annotates a view with markers for side-effects. There is a lot that can be done.
I know it's weird to say that IDEs don't do enough for us in a time when nearly all IDEs give you incremental compilation, refactoring, code completion, and hints. But, sadly, the fact that all of that is possible now hasn't yet touched or influenced language design in the mainstream. And it should.
If we ask our tools to give us more information about our programs we might find that we have less to type, and less to change when we do need to make changes. I think I'd like that.

Comments (8)
It is interesting you say that language design hasn't been influenced by the tools. I would say the opposite is true!
Maybe I am looking at thing too broadly in that it is really a mix language and conventions that have been considered. But I still believe languages like C# and Java would not be what they are without a consideration for the IDEs people would use to work with them.
The Python world has done very well without an IDE and I think it is primarily because the language bisected the problem. The interpreter functions as the intellisense and debugger most of the time. The naming conventions and style is more brief because code completion is not assumed in the editor. One could even argue that dynamic typing is partly a reaction to constantly mixing compiler specific details within algorithms.
I should mention that I have no problem with IDEs. I am an avid Emacs user so that might place a rather large bias on my thoughts, but overall the IDEs and refactoring tools are pretty amazing. You even see tools such as Bungee Connect (http://bungeelabs.com) who have created a point and click IDE in the browser that can seriously compete with something like Visual Studio and Eclipse when it comes to creating frontend systems based on web services.
Great post!
Posted by Eric | October 25, 2007 12:23 PM
It's not hard to make a Haskell editor show the types of functions, or even the types of arbitrary expressions. I've got a bundle for TextMate that does this, you just select the expression and hit ^h to get a tool-tip showing you the type. I haven't packaged it up yet, but I've been meaning to.
Pretty easy though, most Haskell compilers and interpreters will do all of the heavy lifting, it's just a matter of how easily extensible your editor is. That's what I like about TextMate, really. I can write a script, in any language I want, to do just about whatever I want to my code, and it will integrate into my text editor.
How extensible is Visual Studio?
Posted by Peter Burns | October 25, 2007 11:17 PM
Ah! Fascinating! Both the idea you so neatly summarize with your title and the observation that it may lead to our "replacing prohibition with information." I've long thought of the idea myself as reading processors (what would be to reading what a word processor/text editor is to writing, what a spreadsheet is to manipulating numbers?). For instance, I've oft envisioned a Wikipedia view in which article text would be heat-highlighted by recency. It just might prove useful enough to help keep the encyclopedia as open as possible while improving accuracy. That is, to replace prohibition with information.
Posted by elzr | October 26, 2007 12:24 AM
Did you try ReSharper? ;)
Posted by Oleg | October 26, 2007 3:11 AM
Oleg:
Only a very early version of Resharper was in play.
Posted by Michael Feathers | October 26, 2007 9:44 AM
With Resharper, Visual Studio is unstoppable when it comes to refactoring, but I couldn't imagine using Visual Studio without it.
Posted by acl123 | October 29, 2007 1:29 AM
elzr:
Re your reading processor idea. I'd love to see something like that for IDEs.. Imagine a plugin that turns the background of your code subtle shades of yellow if it has various code smells, or something which shows the areas that have been edited most recently.
Posted by Michael Feathers | November 5, 2007 8:28 AM
> something which shows the areas that have been edited most recently
Kate (KDE Advanced Text Editor) has something somewhat along those lines for open files: namely, it highlights files in the filelist by their recency. It uses shades of two colours: red for editing and blue for viewing; and the colours mix, so that file which has been both edited and viewed gets purple.
Posted by divide | November 10, 2007 5:07 PM