Tuesday 19 October 2010

Fortress Eclipse

Know Thine Secret Passageways

As mentioned previously, I think Eclipse is a great IDE. It somehow reminds me of a massive medieval fortress - must be all the grey in the UI.

  • It's tremendously strong, with huge thick walls that take a long time to get into (learn).

  • The rather lengthy startup time is required to muster the troops (plugins) for inspection by the king (you, the Eclipse user).

  • Once you're inside, there's a thriving marketplace and you rarely need to leave. Every now and then (version control) riders arrive with news from remote parts.

  • There exist innumerable secret passageways (keyboard shortcuts) that can get you to anywhere in no time

  • Very occasionally, the king lowers the drawbridge and allows his magnificent new (code) carriage to be seen by the lowly peasants at the bottom of the hill ... OK, OK I'm going a bit far with the whole castle analogy, but there's a point coming, I promise!

Eclipse is a very large, very complex product - I actually consider it a greater achievement than something like OpenOffice (which in itself is an extraordinary effort) because it's designed for arguably the toughest critics of all - fellow programmers. When you first arrive in the castle, it'll take you a while to find your way around, but you should not just stop there. You might not get lost any more, but it doesn't mean you can't get to know as many "secret passages" as possible!

I was in a code review today and watched a fairly senior Java developer bounce his way inefficiently around the Eclipse UI. I told him these keyboard shortcuts and he was immediately "closer to the code" rather than grappling with his IDE:

  • Ctrl-Shift-T-Open Type: Most of the time it's quicker than Ctrl-Shift-R (Open Resource) for opening a Java class because none of the .xml, .properties et al malarkey gets included. Also, you can configure Type Filters from the top-right triangular drop-down to always ignore certain packages (e.g. filtering the hated java.sql.* means you never have to pick which Date you meant)

  • (With a class name selected) Ctrl-T-Type Hierarchy: Essential for clambering up and down an inheritance tree

  • (With a class name selected) Ctrl-Shift-G-Find References: Vital for seeing how extensively a class or interface is used

  • (With a field/method/class/parameter name selected) Alt-Shift-R-Rename: With practice you can attain vi-like levels of keyboard-driven speed with this refactoring shortcut.

Hopefully these tips (whether new to you or just a refresher) will help you next time you're touring the castle.

No comments:

Post a Comment

Comments welcome - spam is not. Spam will be detected, deleted and the source IP blocked.