|
Monday, November 26, 2007
From C# to Java: Part 3
Until about 2002 I had a broad disdain for most IDEs. I
just felt they were too pushy. They were always trying to take control
over my build system or the layout of my source tree. If I'm going to give
those things up, I want something in return. For a long time, the tradeoff
never seemed fair. THINK C on the Macintosh was one of the only IDE products I
actually liked.
Visual Studio .NET 2002 was the first Windows IDE that won
me over. I still use vi or emacs almost every day, but I'll admit that I now use
Visual Studio more.
Last year I switched to Visual Studio 2005, and I love it.
This is a product that is so perfect I worry about its next release. Now that
Visual Studio 2008 is out, I'll probably give it a try at some point soon. But
Visual Studio 2005 is sort of like "if it works, don't mess with it". The last
thing I want is for them to screw it up, and I can't really imagine how
it could be better.
I guess when it comes to IDEs, I'm just not very
imaginative. :-)
I started using Eclipse a few weeks ago, and now I
understand a bit more about where Visual Studio has room to improve. I think
Eclipse is amazing, and I've barely scratched the surface.
So anyway, here are a couple of my current favorite Eclipse
features:
Constant Builds
When I first installed Eclipse, the very first thing I did
was look for the menu item to start a build. When I didn't find one, I assumed
that the Eclipse menu system must be too cluttered and counterintuitive. How
could they make such a frequently-used command so hard to find?
Of course I now understand that Eclipse has no build
command because it is automatically building all the time. In fact, I've
quickly become rather hooked on this feature. I once got it confused, but
mostly it Just Works. I make code changes, save the file, and the Problems
pane automatically shows all the current warnings and errors. Sweet.
In fact, this morning I fired up Visual Studio 2005 to fix a
bug. After making the code change, I saved the file and just stared at the
bottom of my screen, waiting for the compile. A few seconds later I realized I
had to press Ctrl-Shift-B.
Quick-Fix
I really like the Quick Fix feature of Eclipse. Basically,
whenever I have a compile error or warning, I put the insertion point into the
offending text and press Ctrl-1. This invokes the Quick Fix facility, which
pops up a little window showing options to automatically fix the problem. For
example, if I am trying to call a method that doesn't exist, it offers to
create the missing method.
Visual
Studio has similar features (Generate Method Stub, for example), but Quick Fix
seems more creative. It almost always offers me several choices for how to
resolve the situation, plus a preview of what the Quick Fix will look like.
This is particularly handy for dealing with exceptions. I
mostly dislike the way Java forces me to declare which exceptions a method
might throw. Ctrl-1 gives me a quick way to either add a throws declaration or
a try/catch.
Bottom Line
I am obviously an Eclipse newbie, so my explanations of its
features are probably wrong. And like I said, I'm just getting started. As I
was writing this blog entry, I discovered "Generate Constructor Using Fields..."
I sure I wish I had found that one earlier. :-)
Anyway, feel free to correct me or tell me what I missed or
remind me that I'm clueless or tell me 7 reasons why I should be using
IntelliJ.
But mostly I'm just saying that the experience of using
Eclipse has given me a much bigger perspective on IDEs in general. In
comparing Visual Studio and Eclipse, I can't really say whether one is clearly
better than the other. Mostly I get the impression that these two competitors
could learn a lot from each other.
|