Change of perspective: A NetBeans testimonial

April 23, 2015 by Michael

This post is long overdue since JavaOne 2014. I’m not getting payed for it, it’s more a thank-you to the whole NetBeans team for bringing some fun back into my everyday coding life.

I’ve been an Eclipse user for a long time, i think way back 10 years ago when it didn’t have a name but only version numbers. Back in 2005 it was for us the only real viable Java IDE around. I remember NetBeans as pretty much unusable for us back then and IntelliJ too expensive. Eclipse felt native, fast and actually, intelligent supporting our development.

What we never did was platform development on either Eclipse or NetBeans.

Back then we often had the problem, that some projects were only deployable from the IDE. Or worse: From one developers IDE. Came ANT, things changed for the better, came Maven (downloaded half of the internet) things got even better. Today i wouldn’t touch a thing that is not build able with standard command line tools. I’m actually a big Maven fan, but Maven and Eclipse relationship has been complicated, at least to say, but I made it into a requirement that every productive project or module should be buildable by maven. Having that, we ran into a lot of problems with M2Eclipse over the years, it never was fun. Also updating any installation of Eclipse is a sad thing. Sometimes it works, more often not.

Anyway, we did great stuff with it and with Spring Tools Suite appearing somewhere in 2011/12 for me many problems with Eclipse vanished with the nice pre bundled stuff.

By the end of 2013 i was (and actually, i still am) pretty bad frustrated by project that involves a framework I prefer never ever touching again and some AspectJs that repeatedly crashed *only* in the IDE.

Looking for something relaxing, inspiring i aimed for a clean and simple Java 8 project and i ended up with this. By February / March 2014 the only IDE offering good Java 8 support was NetBeans 7.4 and in March, NetBeans 8, so choosing a new IDE was pretty easy.

Not wanting to change everything, that was one of the first steps:


keys

Setting the profile to “Eclipse” allowed me to keep my old habits regarding shortcuts, navigation and stuff. By now, I’ve switched to the NetBeans profile.

Working out of the box is the great Maven support. Without adding anything to a project (apart from a project specific settings file), everything works as is. Didn’t have any problems regarding lifecycle management or a plethora of additional xml files per dependency like IntelliJ creates. Great.

Learning: NetBeans did help me (and now my coworkers) to get my head around Java 8 lambda expression and basic use case cases:


learn1

into this


learn2

Pretty basic, sure, but everybody needs a starting point and replacing anonymous inner classes is an immediate win.

Some day i was rewriting a complex computation and i discovered “Use functional expression” hint. I didn’t expect it to work as the variables used weren’t effectively final but NetBeans pretty much did something like this:


learn3

The Reduction was actually way more complex than this. I was pretty sure that this was working because I had written tests and already added the JaCoCo Maven plugin which is detected by NetBeans and ensures me that everything is green as described here.

Speaking of code quality: I actually like the NetBeans code formatter, adding curly braces for every branch of control flow and so on. I guess one of the only things i’ve changed are spaces to tabs (yes, i use tabs. I want semantically correct empty space, not spaces).

JavaDukeTeach_larger (Image from Coding Dude) More teaching and learning: NetBeans has an excellent build-in HTML, JS and CSS editor and all of them work hand in hand. The HTML editor proposes CSS classes the platform finds in css files in the projects, as does the JavaScript editor. The later knows about AngularJS functions, attributes and more. Some of my coworkers always look for WYSIWYG editors: I didn’t even bother, i’m way faster with that kind off assist and i learn stuff with it. Also, the pom editor: It completes group and artifact ids and also suggest the most current version. If i do need a GUI editor (for example creating FXML files), NetBeans knows how to call JavaFX scene builder.

The power of content assist also shines with the nb-springboot-configuration-support, which is demonstrated by Geertjan at Oracle.

Other things i’ve used repeatedly: The very fast local history, the ability to restore unversioned files from local history and fast file compares. Fast navigation between classes and corresponding test classes and certainly the good Git integration.

I’ve encountered only some minor problems so far: Sometimes my installation hangs during download of JavaDoc for whatever reason i don’t know. There seems to be a problem with Java 8 parameter names sometimes, but for the last year no bigger deal.

We at ENERKO have used NetBeans 8 through 8.0.2 for the last year creating two successful Spring Boot projects in the energy / commodities market. One an AngularJS application and the other one a traditional, server side rendered Java project. There’s wast knowledge around another Oracle product in our company, namely Oracle Database, but not that much modern Java web stuff, so being able to teach without distraction by tools was essential.

NetBeans IDE helped me a lot learning and teaching modern Java technologies without wasting time on configuring, explaining build failures due to configuration errors etc. and instead concentrating on stuff that actually matters to us: Creating great software. Reducing unnecessary complexity in tooling is an invaluable asset for modern software development.

So, the change of perspective brought by changing our main IDE changed actually more than an IDE.

(By the way, another great application based on the NetBeans platform is the Oracle SQL Developer, useful not only for Oracle databases but for many other databases with JDBC connectors.)

No comments yet

Post a Comment

Your email is never published nor shared. Required fields are marked *