Tuesday, May 29, 2012

Adventures in Eclipse-land - Coming to Eclipse from NetBeans

When working with JBoss AS 7, it appears that it's just assumed you'll be working with Eclipse. Nobody seems to really talk about NetBeans, the IDE I've been using most of the time for the last few years. I thought there had to be a reason for this, and decided to give it another go.

I'll be jotting things as I go in the hopes of helping others out, and to highlight potential usability issues.

So far, it's pretty simple. Eclipse is painful to use in places, does some things quite strangely, and it's all worth it for the dynamic web module. I cannot possibly express how wonderful it is to use after the compile-redeploy-test cycles I've been doing while using JBoss AS 7 on NetBeans.

Powerful but harder to use

Compared to NetBeans, Eclipse looks to be more powerful, but has a more confused and haphazard UI.

It's very configuration heavy, with multiple interdependent modules having to be enabled and/or configured to work with projects like JSF2+CDI. The help messages (Markers) that tell you what you have to enable don't have a helper that enables it for you or any hint about where in the UI to go to turn it on. I need "Dynamic Web Module 2.5" for JSF2 support, thanks! What the hell is Dynamic Web Module 2.5 and how do I get/enable it?

Last time I tried Eclipse it was pretty horrible to use. On first impressions it's come a long way since then, with a much smoother and more discoverable/navigable UI, but it still has a long way to go in terms of discoverability and usability.

Dynamic compile-on-save, deploy-on-save

I love the deploy-on-save support for JBoss AS 7.1. It's the main reason I decided to give Eclipse another go, and it's why I'm sticking with it as it spews its unhelpful hints and weird errors at me. I can't stress enough just how awesome the dynamic web app stuff in Eclipse is, and how badly it is missing from NetBeans at least when working with JBoss AS 7.x, which NetBeans doeesn't support at all.

When working with NetBeans, I was doing full Maven build-and-deploy cycles for every small change. This took a good minute or two each time even if I skipped the unit tests, and was seriously adding up. With Eclipse, xhtml page changes take a second or less. This is bliss.

Hints are often unhelpful

Sometimes the help/hint messages are downright frustrating. For example, I created a testcase from the maven basic web archetype org.apache.maven.archetypes:maven-archetype-webapp. Shortly thereafter, Eclipse complained that "JavaServer Faces 2.0 requires Dynamic Web Module 2.5 or newer". No hints, no nothing. Didn't find anything with Google. A bit of digging revealed that the Dynamic Web Module is an Eclipse facet (module) that supports deploy-on-save etc with web projects, and that it's configured through the project properties in the "Project Facets" tab, so I enabled it and added Java 7 as it demanded Java 1.6 or newer. The message remained even though everything appeared to be configured as it demanded. Even weirder, I can't reproduce this on my workstation at work, with the same OS, same version of Eclipse, same archetype, same version of JBoss Tools, etc..

Another case of rather unhelpful messages was when I added a Hibernate JPA connection to the project because Eclipse was complaining "No connection specified for project. No database-specific validation will be performed.". (should really be hyperlinked to project connection properties, or at least mention it's talking about the JPA properties). This landed up producing another unhelpful message, "Console configuration “” does not exist". Again, I can't reproduce this on my work machine! It also offered no hints, though this post from someone else who'd hit the issue proved useful.

Maven support not built-in

It's truly bizarre that it doesn't ship with Maven support. You have to add it from eclipse.org/m2e/ via the update page. Eclipse doesn't even bundle a preinstalled update site for maven. For something so commonly used, this is just weird, and makes Maven support feel like a 2nd class citizen. It's a pain having to go through the slow update center, license acceptance and restart process. However, it works well once installed.

I'd love to see m2e predefined in update center. Even better, Eclipse could bundle a stub version that showed the Maven options for project import, etc, and installed m2e when they were used. Right now, unless you know about m2e, it's really confusing trying to open a Maven project in Eclipse.

Marketplace vs Install New Software...

It's not obvious to a rank newbie like me that I should ignore the "Install new software..." option when I want to install new software, and instead use the Eclipse Marketplace.

Perhaps "Install New Software" would be better called "Manually add software repository..." or something that more clearly makes it an option for people who know what they want? "Eclipse Marketplace" isn't exactly informative either; I'd want to call that "Install new software..." or "Discover add-ons..." or something, really.

Software installation is slow

Eclipse makes you wait between every stage of a software install.

Select software in marketplace. Wait for description and component list to load. Select software. Wait for license page. Accept license. Wait for install. After a while may get an unsigned content message that holds up the install. Wait for that, accept it. Wait for "restart IDE" message when install finishes.

Here's what I'd love to see happen: When you view a package in Marketplace, it downloads an info bundle containing (a) description, (b) licenses, and (c) manifest including signatures or lack thereof. Manifest list and license acceptance are thus free of further slow network waits. Display a checkbox for accepting unsigned software on the manifest list if there's unsigned software present, rather than prompting for it with a (focus stealing - ARGH!) popup, and offer "Restart IDE after install?" as checkbox there too so IDE auto-restarts without another blocking prompt. Once user accepts install, just do it unattended and restart IDE, so it's done when they get back from getting their caffeinated beverage of choice.

For bonus points, fast HTTP pipelineing and/or roll-up archives could be used to avoid the need to download the tens or hundreds of tiny little files Eclipse software updates seem to like to pull down. All that latency adds up to a really slow install for even a small package. The marketplace data should be cached; downloading the main marketplace list every single time you open the dialog gets tired fast. Especially when it downloads the "Featured" data you may not even want, blocking the UI while doing so and making you wait even longer to be able to do a search or view the "Popular" tab.

Being able to select multiple things for installation would be a huge help too. I wanted to install m2e, jboss tools, and egit. I can't do them all in one go, I have to come back and attend to the IDE between each install step. I have to wait for the Marketplace to slowly load each time. It's a really slow way to do setup. I can background an install, but can't queue another one up until the first one finishes. Painful.

Focus stealing

On both Windows 7 and Gnome 3 Shell, I've noticed that Eclipse loves to steal the focus with pop-up dialogs and notifications. I've already accidentally applied actions to several of them because I was typing when they popped up. Kill. All. Focus. Stealing..

UI stalls

The Eclipse UI stalls for really, really long periods sometimes. For example, when I tried to use the context assistant to show RichFaces versions available from Maven when adding a dependency, it took 5 minutes for the UI to respond again. No progress indication, no nothing.

No comments:

Post a Comment