Just as if there were not enough blog posts on the internet on Netbeans vs Eclipse, I decided to add one. Actually humor aside I’m faced with a serious issue on a recent project. Here’s the situation.

I normally use Netbeans on my MacbookPro and pretty content with it. Every now and then I get tempted to *try* Eclipse and then leave aside for the comfort of Netbeans. But in this last project I was required to use Eclipse.

Although I’m not a big fan of Eclipse, I’m also not against it. Esspecially after Oracle bought Sun Microsystems, I felt a bit uneasy with the fact that NetBeans will not have SOA pack again, which included pretty useful roundtip editors for BPEL, WSDL editing and JBI tooling on Glassfish. Nevermind, that which is a topic of a another post. It was clear that for SOA orchestration tooling I’ll be using Eclipse in the near future so better get used to it.

To be honest, I was not expecting that much of Eclipse Helios but I found out the JavaEE support to be very decent. My current project does not leave me time to play with all aspects but I’m trying to make a slow transition to Eclipse at least trying to be “bidelingual” for whatever that means.

This list is by no means complete but I’ll surely try to be neutral and focus on productivity first. I’ll also try to update this post as requent as possible to keep it up-to-date.

Update – Jan 6th.

Afer having coded exclusively in Eclipse for a couple of days, I’ve found some points in favor of Eclipse as well as some updates to the issues I’ve written. Shortcuts still feels weird tough.

Update – Jan 7th. – I kinda like WTP but still miss Netbeans for all those small things

Today is a day I miss Netbeans. I still could not get used to navigating between code windows and tests in Eclipse. I had to install a plugin to switch back and forth between test and class file and had to edit preferences for a keybinding to switch between code tabs. As I’m writing this update I’m still shocked that not only there’s no keyboard shortcut for cleaning console in Eclipse, but there is a related bug reported opened in 2004. Can you believe that?

On the other hand, I’m starting to appreciate the way of WTP. Take developing a web application with Apache. If you’re not a neat freak you surely would prefer using maven for your dependencies instead of managing sources, jars, and javadocs yourself. That is kinda not so friendly with Netbeans (which is a topic for another post)

Update – Jan 16th. – Project complete with Eclipse
I completed my first project in Eclipse. It included maven, tomcat and extensive testing. I believe I’ve given Eclipse a fair share of chance. I’ve got acquinted with most of the shortcuts. For maintenance until next release I’ve switch to Netbeans for adding new functionality and doing more tests and debugging. My direct reaction was “the font size is HUGE”. Anyhow, the table below contains my updates to both Netbeans and Eclipse sides.

Update – Feb 18th. – Rework the same project on Netbeans For Next Release and Fixes

Last month I’ve completed a full project in Eclipse which includes maven, tomcat. It did not have anything visual but rather lots of restful web services.  For almost a month I’ve switch to Netbeans for next release & bugfixes. That means lots of more testing and compilation. I’ve got some mixed feelings on maven support. First of all it’s a breeze to see that maven build = netbeans build, like in ant build = netbeans build. The notion of synchronization of IDE with maven is not present in NetBeans. This is a huge plus.  However it’s a torture to test by restarting tomcat everytime. Another plus was the test integration. I kinda liked the independent nature of testing in Eclipse but maven testing really sucked because I had to go back and forth the surefire reports outside the ide. Netbeans does a very decent thing. First of all it’s maven who runs the tests. When errors occur, the output contains a link to the surefire report of the failing test. You just click to see what went wrong. In Eclipse, the output of test goal is barely useful. Now it’s time to update the table below and move on to the next step. Which includes more maven comparison.

The second release of the project I’m working became a multi module maven project with multiple profiles and some locally provided dependencies. Netbeans experience was very comfortable with being able to easily manage dependencies, attach local source and/or javadoc jars. Multi profile support in Netbeans is great. Since maven is native to Netbeans, you just select the profile from appropriate run dialogboxes of context menus.

I though I’d miss the intelligent code completion in POM XML editor in Netbeans which provides version, groupId and artifactId but it turns out to be misleading sometimes. Esspecialy if you set and change repositories, the index could get out of sync. Of course you can update the index if you have the patience to wait but I think POM XML completion of dynamic content is not as sexy I though it was. (as in real life:) )

Update – Feb 27th. – Spend some 10 days with Netbeans refactoring my code to maven multimodule projects.

Well for almost 9 days, I’ve been coding, testing, refactoring, testing and coding again. I’ve evaluated 2 major libraries (topic of another post) employing maven. First the little annoyances.

Netbeans misses the freshness of the classes while doing tests. Let me explain briefly. Consider you have a maven project. You’ve written a junit test for a class. You run the test (via “Test -File”) and get failures. You go back and make changes in your class and come back to the test again and hit “Test-File”. Normally, Netbeans runs the compile target for your project and executes the tests via maven for you. Well, what generally happens is no compilation and execution of the same compiled test again,resulting the exact outcome of your prior run. You get the same error messages for the lines that does not even exist in the class. In practice you have to “clean and build” in order to get it right.  On the other hand Eclipse’e maven surefire test integration sucks so much that I didn’t mind until a point where it compilation started to take a minute or so.

Now the good parts. When you create a project in a directory where a pom resides, Netbeans automatically populates the parent and module information in both projects pom files. The “Libraries” node on the project tree directly display the inherited libraries and you are good to go. Since I did not use site generation I could not find much to do with the parent module project.

Up until now, I’ve been coding libraries. They are pretty heavy duty and accessible via REST API, direct jar import or scripting. There are however 3 more challenges I need to try before deciding.

1- Develop a GWT application backed with JavaEE6

2- Develop a Grails project

3- Develop a persistence and JSF intensive application backed with JavaEE6

Here’s the updated table

Yeay Netbeans Booo Netbeans
  1. Code completion is much friendlier in Netbeans. When compared to Eclipse, the first option is always more reasonable then what Eclipse offers
  2. Code templates are more recent. Write “fori” press tab you get classic for loop. Write “fore” press tab you get the new for loop
  3. Awesome maven support. When editing pom files you get code completion even for version of dependencies. Incredibly useful feature
  4. Debugging in Netbeans feels much more comfortable than with Eclipse. I’m not comparing habitually. Netbeans nicely provides autocomplete in “all” expression and watch windows unlike Eclipse and hovering over any expression yields it’s contextual result. This really speeds debugging when testing.
  5. When running tests for maven, for any failure, you get by default a message including a portion where you can click to go to the code. In Eclipse, you’re required to examine surefire test report.
  6. When adding a maven dependency which is also a project in Netbeans, you can easily go back and forth on the source code. However you need to “build with dependencies” or “clean & build” the dependent project to make it active.
  1. Maven support is great except one glitch. When trying to develop a web application with maven, Netbeans tries to bind with maven build cycle, which takes time and not very suitable for hot-deploy.
  2. Why can’t I drag and drop a file from my file browser?
  3. Ctrl-click a method name and you’re navigated to the interface file. I wish there was a way to navigate to the current implementation in context. Actually there is!. I was surprised not to have noticed so far. Ctrl-Shift click jumps to implementation. If it popped up or showed a small drop down box I might have not take Ctrl-click for granted.
  4. Font size is HUGE, and the default font (at least on Mac) looked annoying after spending some time with Eclipse. Although I’m not a fan of SWT, Eclipse looks a bit crisp. (I’ll try the same font and font sizes. )
  5. By default, running a maven web application executes related maven goal, which reruns tests. If you don’t want to run all your tests on every change, you should set the skip tests in maven options.
  6. In practice you cannot avoid restarts for tomcat. Not tried maven mangling for hotdeploy yet.
  7. While testing in a maven project, when you change code not directly imported in test code (I suppose) sometimes test code is not recompiled. This can also be due to fast edit-save-test cycle. Not positive on this one. (Feb 27th. : verified to be a major PITA)
Yeay Eclipse Booo Eclipse
  1. Maven web application deveopment is fluent. Although you use maven for build cycle, Eclipse treats project as a WTP project and deploys, runs and tests outside maven, which provides a faster roundtrip esspecaily when developing with Tomcat.
  2. It is very handy to be able to donwload server runtimes.
  3. Integration with native filesystem is great. I can drag and drop files on the project tree
  4. Even code folding is also advances in Netbeans, it feels more natural in Eclipse with Ctrl- numpad shortcuts. Maybe that is because Eclipse by default keeps imports organized and folded.
  5. As already said above, I like Eclipse organizing imports. Although I’m not freaky about keeping imports sorted and aligned, knowing that imports are tidy in the folded code is OK and saves a couple of mouse scroll-wheels
  6. Ever heard of programming agains interfaces? I think Eclipse guys had. One of the little annoyances in Netbeans is when you Ctrl-click a method name if it is an interface you are taken to the interface source file. In Eclipse a small context menu appears and asks you “Open Interface” or “Open Implementation” . Very useful.
  7. Move the cursor to the method declaration line of a JUnit test and select Run As > Junit Test. Only the selected test method in the JUnit file runs. Pretty usefull
  1. Code templates are not very user friendly. No new for each loop out of the box. UPDATE: There actually is a new for loop shortcut, but it is useless compared to Netbeans. In Eclipse, writing “fore” and Ctrl-space requires you to enter iterable type, iteration variable and the iterable. In Netbeans when you enter the iterable variable the iterable type automatically gets populated. It’s small but it saves time.
  2. Maven pom editing is lame. Treats like just another XML file
  3. What is the point in putting the JUnit runner in the left pane? Ok we all have widescreens but any assertion failure produces plenty of text. I pulled it next to console  the first time I ran it.
  4. It’s very lame that any failure output is in the form of list in JUnit runner. You cannot select and copy. That is very useful when you write your initial expectations with empty data. You have to copy all to an empty scratchpad or a text editor to play with.
  5. I really disliked debugging in Eclipse. I consider myself a pretty TDD guy by once in a while you need to debug. It’s very useful for learning specifics of frameworks, domain models by inspecting them during testing. One of the things I do in Netbeans is hover over an expression in my java code and see the result in tooltip window. Eclipse lacks this behavior even it says “you can use Ctrl-Enter here…” UPDATE: I’ve found “inspect”. It’s in the context menu while debugging. Although it opens up a weird dialog and getting rid of it is not easy, Eclipse has  inspection by selection which is important.
  6. Not only lacks hovering over expressions I could not get autocomplete in watch/expression editor. Disappointing.
  7. I was disappointed to find out that there were no shortcut for navigating to and from unit tests of the class in context. In Nebeans if you follow the ClassName and ClassNameTest naming convention it’s just a keysroke to go back and forth. I’ve found a plugin called MoreUnit, which is OK.
  8. Not only there’s no keyboard shortcut for cleaning console in Eclipse, there’s no way to assign one. In Netbeans there’s Ctrl-L
  9. Even though the default font and the font size looks much better than Netbeans, bold style is not much distinguishable than non-bold. My eyes efinetaly got tired for not having a real bold method names.
  10. If I’ll have to review the surefire test output after every maven test run what is the point of having an IDE?  Much better in Netbeans