Friday, November 9, 2007

Best feature in NetBeans 6.0

You might have heard tons of information about NetBeans 6.0 in recent days.

I'm using NetBeans 6.0 Beta 2 for almost 2 weeks now for some of my development activities.
Though it had lots of new features available, the new refactoring is the feature which impressed me the most.
(Note: So far, I have used the ide for Java SE projects only)

Refactoring in NetBeans 5.5 is good, but in 6.0 it's outstanding, i must admit.

I heard that refactoring has been improved in 6.0, but i didn't spend time reading what were the improvements.
So when i first pressed the shortcut key to refactor a local variable, it highlighted all the occurrence of the variable in blue and when i started to change the variable name in one place, all the highlighted occurrences were changed simultaneously. This is really excellent!!!


Figure 1: All the occurrence to be refactored are highlighted.

Now when i start changing it, all the highlighted occurences change simultaneously.



Figure 2: All occurences change simultaneously

This is the view after refactoring is done.


Figure 3: View after refactoring

Great, isn't it?

I was even more impressed when i stumbled across one more astonishing refactoring feature....

This time, i wanted to change a method name used in more than one class and what better than the netbeans refactoring?

I want to change a method name "getAESEncryptedText" to "getEncryptedText", but this method is referred in more than one class. So when i pressed "CTRL + R", this is what i got.


Figure 4: Refactor dialog


I wanted to have a preview of the places where this change will be effected. This is the preview offered by the ide:


Figure 5: Refactoring preview

That is outstanding. You can see exactly how the refactored code will look like in the preview pane.

I was thrilled by this offering from netbeans.

Now i'm motivated to compare the refactoring module offered by netbeans and eclipse.

Interesting times ahead for the developers....

13 comments:

Anonymous said...

Doesn't look like you have heard of IDEA.

Anonymous said...

...but IDEA costs real money, while Netbeans is free.

Netbeans is as good as IDEA in many areas, better in some and weaker in a few - but its free, which makes a massive difference.

Anonymous said...

Eclipse is also free. Why not to give it a chance? :)

James Selvakumar said...

I've used IDEA for the past 3 years dear. Please read some of my previous posts.

Anonymous said...

Eclipse is doing this refactoring stuff for a long time. Have a look at Eclipse 3.3, which is way cool than NetBeans.

Handerson Gomes said...

I've used Eclipse for a long time now and have used NetBeans 6.0 for some time, few months actually.

The overall Java Editor in Eclipse is still way better than NetBeans 6.0 and also more responsive. Tasks like refactoring, coding suggestion, navigation through code, tabs and classes hierarchy is smooth and more intuitive in Eclipse than NetBeans.

But there are nice features in NetBeans especially in the JEE side (where I have spent most of my time). I found the NetBeans/Glassfish integration better than Eclipse/Tomcat. Also the wizards are very helpful when you want to prototype and play with some ideas like WebServices, Rest or EJB3.

James Selvakumar said...

Hi friends,

Thanks for your valuable comments.
I'm using eclipse 3.3 as well. In my opinion, eclipse java editor is still miles better than netbeans 6.0. But this blog posting is not a comparison between netbeans and eclipse. It just explains some of the netbeans functionality. That's it.

I've published a separate article on this blog about the greatness of eclipse 3.3. Please read that as well and give your comments.

Samant said...

Netbeans Profiler is a real killer !!! Eclipse cannot match that still..

Try renaming a class in Netbeans from the folder view and it sucks !

Anonymous said...

The Netbeans Profiler eh? Try googling for Eclipse TPTP.

Anonymous said...

This automatic renaming utility was present in JBuilder a long time ago, though I appreciate that NetBeans 6 is not featuring it because it's my IDE of choice now.

Anonymous said...

JBuilder/Eclipse sucks for J2EE/Servlet/JSP applications!!!

Anonymous said...

do you know how to refactor without preview?
I would like eclipse refactor style more... :-o
I feel it's NOISY while refactoring something every time.

yonkul said...

www.turksohbetim.net