Some of you will have read Steve Yegge’s 3500-word rant about programmers who can’t touch type (from whence I unashamedly stole this post’s title) or at least Jeff Atwood’s more succint version of the same idea. For those of you who were too lazy to read the above, the basic premise is that non touch-typists are less productive than their touch-typing counterparts. Today I’m going to talk about another group of people, who are equally annoying: programmers who use their IDE as if it were just a file manager with a built-in text editor.
When I started my first Java-related job, I remember thinking to myself that one of the best things about developing with Java was the excellent IDE support for code navigation and refactoring. Despite the fact that IDE support has only gotten better since then, I still see people search for a Java class by repeatedly expanding folders in the package tree until they find the right file (normally pausing to think which package the class is in) or rename a method using a primitive cut & paste technique. These are inefficient ways of doing something that is 1 keyboard shortcut away, or 2 clicks away, and are really frustrating to watch (a bit like being stuck behind an extremely slow driver).
When programmers don’t take the time to learn the IDE’s features, but I don’t think laziness alone is the cause. In fact, I believe laziness makes good programmers, at least when coupled with an inclination for problem solving. Take me, for example: I am one lazy bastard. I need to find a class. I’m going to hit Ctrl+Shift+T and BAAAM, I’m all up in that mother. There is no way I’m going to move the mouse around and click like crazy to get there. These guys are different: they don’t mind repeating the same mind-numbing cliking, typing, copying and pasting, over and over again. Perhaps they think that’s what programming is about?
It’s getting late and I’m not drunk, so I’m going to have to wrap this up. Here is my contribution to the betterment of Java programmers everywhere (Eclipse only, sorry! I now know better):
- Open Type (Ctrl+Shift+T). Tip: use only the first letter of each capitalised word (e.g. BAOS for ByteArrayOutputStream).
- Open Resource (Ctrl+Shift+R). Same as above.
- Quick Type Hierarchy (Ctrl+T). Use this on a method to see where it’s overriden or declared.
- Rename (Alt+Shift+R). Use this to fix names that suck.
- Extract Method (Alt+Shift+M). Apply when you want to reuse that sexy piece of code elsewhere.
- Extract Local Variable (Alt+Shift+L) and its counterpart Inline (Alt+Shift+I).
For more information on the motivation for refactoring, and to understand the mechanics of each refactoring, check out Martin Fowler’s Refactoring book.