12

I personally use CodeRush in Visual Studio 2010 to do refactoring, write code faster with templates and generally navigate my code 10 times faster than stock VS. Recently, I've been working on another Android app and got to thinking...What are the top productivity plugins for Eclipse?

Preferably free. I'm looking for plugins that help write in Java, not PHP or Rails or any of the other languages Eclipse supports.

Jonas
  • 14,867
  • 9
  • 69
  • 102
Ryan Hayes
  • 20,139
  • 4
  • 68
  • 116

6 Answers6

13

Mylyn is a very widely appreciated plugin for Eclipse, and is available on the main Eclipse site now. It can watch the pieces of code that you work on together (for example, when changing "tax calculation" code, you tend to use the same five files) and then emphasize them the next time you work on the same task. It's a great way to undo the "information overload" you get when working on a large project.

FindBugs for Eclipse will help you save time by analyzing your source code for potential Java bugs. It has a false positive rate, and you wouldn't want to run it each build, but it's a great process to go through.

Eclipse's own refactoring and navigation features will save you time as well. My favorite feature of the JDT is the "Quick Fix." When you have an error in your source code (you can use Control-Period to navigate to it), simply do a Control-1 for the Quick Fix operation. It will give you a list of ways to fix the error. For example, if you write a = foo(s), but a is not declared, one of the Quick Fix options is to "declare a". Eclipse will look at the return type from foo and use that for a, automatically adding any imports. With this style, you will find you write code with errors intentionally, because the Quick Fix route is faster!

My other favorite Eclipse shortcut is "Expand Selection To->Enclosing Element" (Alt+Shift+Up). This takes where your cursor is and then selects the element of the parse tree you are on. When you do it again, you move further up the parse tree. This is great, because you can select an entire expression easily, not having to worry about selecting the code before or after it. That makes it much easier for you to have a valid expression in order to perform the "Extract Local" refactoring.

JUnit is indispensible if you are writing unit tests, and it's well integrated with the environment and process.

If you do any work with GWT, then Google's GWT Eclipse plug-in is nice. You can even use it for working with any Tomcat application, not just a GWT one.

All of these tools are available free.

Macneil
  • 8,223
  • 4
  • 34
  • 68
  • -1 for two items: "Eclipse's own refactoring and navigation features will save you time as well" - Ahem. I (and a number of other devs I know) have found the Eclipse automated refactoring to be a pain, to put mildly. Try renaming a field or class name thru Eclipse auto refactoring and you will see what I mean. Secondly: "With this style, you will find you write code with errors intentionally, because the Quick Fix route is faster!" . I am sorry but your statement encourages cowboy-style coding vs. good design practices. – Jas Oct 30 '10 at 23:06
  • 1
    You can disagree, but I don't think it's fair for you to say my answer was not helpful. I also think you should re-read my point: These are not major design errors I'm talking about. I'm talking about when you write new code, much of the bother of imports can be given to Eclipse to organize for you. – Macneil Oct 30 '10 at 23:09
  • This other part may not have been obvious to you either: The Quick Fix *removes* the error. It's a different way of thinking, and I can see how you would be unhappy with Eclipse if you weren't aware of all of its nice features. – Macneil Oct 30 '10 at 23:18
  • @Macneil, If you introduce a variable named "a" without having it declared, then yes you have made a major design error because otherwise you should be able to solve the problem without the "QuickFix". That's Software Design 101. Re. nice features, I have worked in pretty much every major IDE in the past 15 years, and NetBeans or MS Visual Studio have a far nicer set of "nice features", some of them being things like your fav QuickFix. The difference here though is that at least in those tools, unlike Eclipse, everything works properly. Like I said, try using Eclipse auto refactoring. – Jas Oct 30 '10 at 23:57
  • 2
    @Jas: Sorry if I seem to be not getting your point. Are you saying that writing `import java.util.Map; ... Map m = foo()` is "better design" than writing `m = foo()`? Even though the resulting code is the same character-for-character? – Macneil Oct 31 '10 at 00:01
  • @Macneil, I'm sure you'll get my point once you read a few OO design books. The first line could come from someone working based on actual design documents, the other one could have very much been written by a script kiddie who suddenly saw a need for a variable in that spot. I guess your fine command of keyb. shortcuts impresses a lot of folks at the local computer club too :) – Jas Oct 31 '10 at 00:10
  • @Jas: If I understand correctly, are you saying that a programmer could use Eclipse's quick fix style and not know what they are even doing? That is certainly a valid concern. However, many powerful things have downsides or even dangers. "Fire" comes to mind. – Macneil Oct 31 '10 at 00:30
  • @Macneil - Multiple inheritance is powerful. C pointers are powerful. Fire too. But your fav tool in Eclipse is simply a tool for developers without real design to come up with some spaghetti code quickly. Don't overestimate it. – Jas Oct 31 '10 at 00:42
  • @Jas: Thanks for sharing, but I don't see how one constructed worst-case scenario suddenly applies to the average developer. – Macneil Oct 31 '10 at 01:10
  • 3
    "try using Eclipse auto refactoring" I've never had a problem with Eclipse renaming variables/types/methods and producing incorrect. @Jas when was the last time you've used Eclipse, is it recently? And are you talking about the Java editor or the editor for another language? In addition, AFAIK up until recent versions Visual Studio's refactoring options have paled in comparison to Eclipse's. – matt b Oct 31 '10 at 03:04
  • @matt b - Actually I've been using it very recently (in the last few months), and I used a variety of flavors, (such as RadRails), bottom line is, they all suck, and their auto refactoring always produces incorrect results. I don't see how anyone can defend Eclipse, it's such a productivity murder tool. It should be banned by law. – Jas Oct 31 '10 at 03:32
  • @Macneil - A constructed worst-case scenario? Let me quote you again : "With this style, you will find you write code with errors intentionally, because the Quick Fix route is faster!". If you don't see problems with this statement of yours, oh well.. – Jas Oct 31 '10 at 03:36
  • 2
    To be fair to Eclipse, if you are using refactoring options within a Rails/Ruby plugin than the inconsistencies may be the fault of the plugin. – matt b Oct 31 '10 at 03:56
  • 1
    @Jas It's surely not only me who doesn't get what you mean. Maybe for you the *real developer* must *type* each single letter they need? – maaartinus Mar 20 '11 at 15:51
  • @Jas, when you have done some more work with especially complex generic types, you will appreciate any help the IDE can give you to get it right. –  Jun 28 '11 at 08:35
  • @Thorbjørn Ravn Andersen, as a matter of fact, I've done my fair share of work with generics, even with C++ templates (much heavier stuff than generics), but don't see what's so spectacular about the crappy IDE that Eclipse is. If I want some real help, I'll fire up my Netbeans or my MS VS Studio. If I want to shoot myself in the foot, I'll launch Eclipse, for sure. I'm sure these guys must be getting it wrong too: http://lousycoder.com/blog/index.php?/archives/76-Why-I-hate-Eclipse-Europa.html and http://nonplatonic.com/ben.php?title=reasons_i_hate_eclipse&more=1&c=1&tb=1&pb=1 – Jas Jun 28 '11 at 09:11
  • 1
    @Jas, we have a saying that "taste cannot be discussed". It clearly shows that you dislike Eclipse. Fair enough, but no need to belittle it. –  Jun 28 '11 at 09:43
  • @Thorbjørn Ravn Andersen - it really isn't about taste here. I do like that Eclipse is leaner than VS or Netbeans. But that's all that can be attributed to the taste factor. Overall it's an anti-productivity tool. – Jas Jun 28 '11 at 09:59
  • @Jas, I strongly disagree. I find it very productive, but then again I never got around to like Netbeans. As long as the software ship, that is what matters. –  Jun 28 '11 at 10:05
6

Clover - A test coverage tool, but outputs the most lovely reports in the world (costs a pretty penny thou.)

Crap4J - Same general data as Clover (that is to say it is a code coverage tool) but simplified and less pretty (free).

Findbugs - Reports on common coding errors (free).

All can be used as either an Eclipse plugin or a stand alone application.

mlk
  • 1,049
  • 8
  • 18
3

I personally turn to Checkstyle to keep my code on the straight and narrow. It helps point out where my design is growing to bloated and I need to step back and refactor. eclipse-cs is one plugin for eclipse for use with Checkstyle.

JUnit, of course, would be the other defacto tool of choice for my development, but then I this is pretty much supported out of the box if you are using eclipse.

Chris Knight
  • 702
  • 5
  • 12
3

There are some really helpful plugins to increase productivity, my favourites are:

Max
  • 103
  • 4
  • @cloudyster if you add "http://" to the last two bullets, they will automatically be hyperlinked. It would make it easier to navigate (I'd edit it in, but don't have the rep yet) – Mads Hansen Nov 01 '10 at 14:40
3

You may find subclipse a very handy plugin; it makes it very intuitive whether there's changes to be committed or not.

Another suggestion is don't look for more plugins, look into eclipse itself because the features it provides, such as refatoring and source generating, is really very enough for everyday java programming.

I have switched from C++ to Java for around 1 year and really enjoyed the magics eclipse done to me. It's awesome!

tactoth
  • 543
  • 1
  • 3
  • 12
0

I am developing WireframeSketcher Eclipse plug-in. It's a rapid wireframing tool for creating wireframes, mockups and prototypes for all kinds of applications. Notably there are libraries for iPhone and Android apps.

I feel that wireframing should be part of any development process and it's a huge productivity boost. So I put a lot of passion into this plug-in to make it available to every developer. Note that WireframeSketcher also works as a standalone software. This way you can give it to team members that don't use Eclipse.