Tuesday 29 April 2014

Netbeans: There and back again - a tale of frustration, anger and returning to grace

(previously titled: Bye Eclipse the preventor of development, hello Netbeans...)

As always this is mainly for my future self as reference, as I don't seemed to have learned from the same experience that I had previously:(

Don't try to manually add dependencies to the tomcat classpath.

I lost the battle against eclipse + tomcat/tomee + maven

The fact that it works to add your main war dependency to the classpath with the maven library this time, does not mean it will work if you add more. I found that eclipse get's completely confused and this causes problems for things that insist that you may only have one copy of any class in your classpath, eg. slf4j, openejb's faces implementation etc.


Anyways, I'm fed up, fueclipse ┌∩┐(◣_◢)┌∩┐  

Until now I didn't really want to switch to netbeans because it doesn't support my favourite version control system (bazaar) and limited lombok support and I didn't really want to re-learn things/qwirks I spent years learning in eclipse like keyboard shortcuts, configuration, classpath settings etc.
Anyways eclipse makes me so mad sometimes and I think the camel's back has finally been broken. I tried to switch previously but had trouble getting my stuff to work quickly, I think I'm more patient/desperate this time..

Some stuff I've figured out with Netbeans so far - i.e a cryptic Netbeans guide for ex-Eclipse-users (please vote on the bugs I link to!):

  • you can use a use the eclipse keyboard shortcut profile, so for now I don't have to re-learn shortcuts and keep some productivity.
  • maven multi module support works beautifully
  • mvn install happens when you do a netbeans build!
  • Reload POM, seems to be needed sometimes like the "Maven -> update project"
  • adding a tomee server is simple http://tomee.apache.org/tomee-and-netbeans.html
  • you can collapse all, by right-clicking in the white space next to  the file tree (eclipse has a handy everpresent button for that)
  • Netbeans seem a lot snappier than eclipse!
  • Committing with Git works better in Netbeans, because it allows you to modify the files while you are typing your commit message (eg. for fixing typos). I would have like to not manually click to see every file, maybe a open all button would help. I still love the qbazaar/bazaar-explorer's commit gui which give you the whole list of changes in one huge scrollable panel - saves a lot of clicks and navigations. For now I just look at the colordiff in the commandline to approximate that behaviour :(
    • One thing I miss with the Git commit ui in Netbeans, is to be able to push at the same time - Eclipse has a button `Commit and Push`. 
    • It would also have been nice to get some floating/fading notification if the commit/push went well. If you don't watch the statusbar and spot the progressbar disappear you have no indication if it worked..
  • Console scrolling works more intuitively and seemlessly: if you scrolled to the bottom it will keep on scrolling as more output comes out, but if you scroll up it stops auto-scrolling. In eclipse you have to click a checkbox to make the choice between auto-scrolling and not.
  • Project groups seems to work nicely and you can use the Cool Editor Actions plugin to quickly switch between them.
  • Dragging panels around seems to work a bit better than in Eclipse. Eg. sticking an editor in the console tabsheet.
  • It does have bazaar plugin ?! It looks similar to the eclipse qbazaar plugin - it is a thin wrapper around qt frontends for the bazaar commands - very nice!
  • Running more than one instance. I figured out you have to specify a --userdir for the second one and that it can't be the same as your main user dir. I tried to symlink it but that didn't work, so I made a little script that copies it:
    VERSION=8.0
    A=$HOME/.netbeans/${VERSION}
    B=${A}_B
    rm -rf ${B}
    cp -a ${A} ${B}
    /opt/netbeans-${VERSION}/bin/netbeans --userdir ${B} &
    
  • ALT+3 to copy project or file path
Things I miss so far (maybe I'm missing something):
  • Control clicking on a maven artifact reference in a pom file would jump to the relevant pom file.
  • File manager doesn't remember recent locations :( so every time I look for my tomee server, or projects I need to navigate from home :( It would have been better to use the native linux file chooser. My current workaround is the Quick File Chooser - plugin : "file chooser optimized for keyboard-only users. Performs GNU Readline-style filename completion when you press Tab. Shows available completions in a list for quick reference, similar to Emacs. Also includes a persistent list of recently used directories for extra speed." (it works in Netbeans8 if you download v7.4 manually and install it)
  • After installing some plugins and making some configurations it refused start up again. Then I accidentally purged ~/.netbeans :( and it worked again. This happend again so I logged a bug and figured out what triggers it. Back to work now finally, damnit!
  • Searching in the output console is a bit frustrating but CTRL+F and the CTRL+N seems to work ok now.
  • There is no auto-closing of editors. In eclipse you can tell it to close old editors after you have a certain amount open. It gets messy if netbeans keeps like every single file you clicked open - I go through hundreds. I found sort of a workaround in Window->Documents where you can order by last used, then select the bottom bunch and then close them in one go..
  • mylyn is also missed - it helps you focus by hiding some of the project clutter a bit from you while you are working.. Project groups seem to be the closest workable alternative.
  • I like eclipse's run infrastructure better. eg. you can easily run whatever you ran previously (but there are some run shortcuts, so I may get used to it) Found it : ALT+r p
  • Junit test compare in eclipse you can show you a nice diff when assertEquals(String,String) fails..
  • In eclipse you can click on stack trace elements in the console and it would open the file, in netbeans it seems to be a manual proccess :(
  • Test Runner chops off exceptions :(
  • Java Stack Trace console (where you can past any stacktrace and get links)
  • Efficient dependency hierarchy to figure out maven dependency hell

http://www.wikivs.com/wiki/Eclipse_vs_Netbeans

I've been with eclipse since at least 2006.
Living with eclipse is like living with an abusive husband, sure you get a black eye from time to time, but you are so dependant that you end up staying. It caused me numerous sleepless nights and missed deadlines :( not to mention it literally driving me insane. t(-.-)

Back to Eclipse!

After that whole laborious move the development cycle in netbeans was just insanely long for my project setup (a couple of layers of war dependenices/overlays which each need to be built for deploying every small change). I bit the bullet and figured out how to do proper OpenEJB and TomEE embedding so I don't need WTP anymore with its' nasty classpath idiosyncrasies.

No comments:

Post a Comment