Skip to main content

IDE: NetBeans

After trying out Komodo Edit I decided to give NetBeans a whirl. Here's the summary: NetBeans is a pleasant to use, reasonably well-polished IDE that mysteriously seems to be missing certain key features that even Komodo Edit has. If I were to put my finger on it, I'd say that NetBeans is better at being an IDE (doing things such as code completion, code tips, etc.), but has a worse editor (for instance, it lacks a rectangle selection mode and it has no option to rewrap a multi-line comment block).
From the Web Site
Here are some high-level bits from the web site along with some of my own comments:
In addition to full support of all Java platforms (Java SE, Java EE, Java ME, and JavaFX), the NetBeans IDE 6.5 is the ideal tool for software development with PHP, Ajax and JavaScript, Groovy and Grails, Ruby and Ruby on Rails, and C/C++.

Discover the joys of Python programming with the NetBeans IDE for Python Early Access. Enjoy great editor features such as code completion, semantic highlighting, and more. The EA release also includes a community developed Python debugger and offers a choice of the Python and Jython runtimes.
Python is only supported in the early access release. I expect Python support to improve over time.
The NetBeans editor for Python supports Smart Indent, Outdent, and Pair matching, additional to syntactic and semantic highlighting, code folding, instant rename refactoring, mark occurrences, finding undefined names, and Quick Fixes. Code completion is available for local function and variable names as well as Python keywords. The editor also assists you by inserting and fixing import statements.
All that stuff seems to work. I opened a file. It gave me a PyLint-like warning that said, "The first argument to a method should be self or cls. I was using klass. I right clicked on klass and said rename. It renamed all the occurrences. Easy.
With the NetBeans IDE for PHP, you get the best of both worlds: the productivity of an IDE (code completion, real-time error checking, debugging and more) with the speed and simplicity of your favorite text editor in a less than 30mb download.
The IDE stuff works well. However, it definitely can't touch the speed of my favorite text editor ;) The fact that the download was only 25mb (109mb uncompressed) was indeed quite impressive in comparison to Eclipse.
The PHP Editor in NetBeans IDE 6.5 supports all standard features such as code completion, syntax highlighting, mark occurrences, refactoring, code templates, documentation pop-up, code navigation, editor warnings and task list.
The documentation pop-ups are amazing. The documentation for JavaScript even includes browser compatibility notes, and the documentation for HTML is straight from the DTD. Furthermore, the code completion isn't pre-baked as it is in Komodo Edit. If you register a new JavaScript library, it can do code completion on that too.
The NetBeans IDE has the JavaScript tools you need: an intelligent JavaScript editor, CSS/HTML code completion, the ability to debug JavaScript in Firefox and IE, and bundled popular JavaScript libraries. Your favorite JavaScript framework will get you 80% of the way, NetBeans IDE will help you with that last 20%.
Yep, all that stuff seems to work. It was even able to do code completion on CSS content when I was in a PHP file. You probably shouldn't put CSS blocks in PHP files in general, but the fact that it could still parse it and do code completion is impressive.
The Good Parts
First of all, let me say that NetBeans is stable. It hasn't crashed on me yet. It's also pleasantly attractive. I like the rounded corners, fonts, and icons. I don't feel overwhelmed by NetBeans like I do by Eclipse. Also, the training videos were very well done.
The Bad Parts
If I have a multi-line Python comment, there's no way to rewrap the lines. In Emacs, this is M-q. In Vim, it's gq}. I generally consider that a must-have editor feature.

It doesn't seem to support rectangular selections or column editing (i.e. cntl-v in Vim). I always say that that's one of the features that separates the really good editors from the mediocre ones (Vim, Emacs, Nedit, and Komodo Edit all have it). It's such a useful feature. When I searched for "column" in the documentation, one of the search results was how to add a column to a database. That really underscores my point that NetBeans is a great IDE, but not necessarily the best editor.

There are no Vim or Emacs key bindings. That's sort of a bummer. To be fair, no one ever gets Vim key bindings perfectly right anyway. Nonetheless, the IDE is decidedly mouse heavy. Many common editor tasks that deserve a key binding don't have one.

Opening up files is a bit painful. I really missed tab completion like in Vim and Emacs. What's worse is that Apple-o isn't the key binding for opening up a file. In general there are a lot of places where NetBeans follows the standard OS X conventions such as Apple-x to cut, but there are some strange places where it deviates from those conventions.

It doesn't support editing a file remotely using scp.

I don't see a way to tell it to run "make test". Komodo Edit let me run "make test" and then click on file names if there were errors in the output.
Other Commentary
I created a new project from existing sources. On the downside, this created a new folder in my project. On the upside, that folder was only 8k worth of data. I definitely don't feel like I have to make everyone on my team switch to NetBeans before I can start using it. It says that it can synchronize with Eclipse projects, but I don't actually need that feature. During the project creation wizard, it expected my source files and my tests files to live in different trees. That was sort of weird. I just told it to use the same directory for both.

It says it can do JavaScript debugging in Firefox and IE, but I didn't get a chance to try that out.

It supports code snippets, if you're into that sort of thing.

For PHP, it can do code completion of symbols in other files. It also shows you the documentation that you wrote. I tested it, and it worked for Python too.

For PHP, it will warn you of uninitialized variables.

It does have version control support built in. The graphical diff utility was very nice. Committing code changes was painless.

As you would expect, it does provide a line at column 80. As I mentioned before, that was a pain for me in Vim.

The code folding support works very well. Functions are automatically recognized as something you can fold. Better yet, it understands HTML well enough to fold blocks of HTML.

When I opened a Python file, there was a widget that showed me an outline of the file, including all the classes and methods. It worked pretty well in PHP too.

It said that "from __future__ import with_statement" was an unused import. I think that's a sign that its Python support is still pretty young.

There's a margin to the left of the code that shows me what lines I've changed. It's like the diff is built into the editing experience.

In general, the code completion is pretty good. However, it got confused when I typed "from a import b; b.something". I think it didn't understand that I was importing an entire submodule.

The code completion for "self." was pretty helpful. It even showed me my own docs.

If I type "from a import ", it shows me a list of things I can import. That worked pretty well. However, when I picked something, it included the argument parameters like "from a import b(c)", which was sort of a weird bug.

When I'm calling a function, it tells me what arguments that function accepts. That works for builtin functions or functions in the current file, but it doesn't seem to work for functions in my other modules.

It recognizes JavaScript syntax errors, even if I'm in an HTML file. It knows that 10p is not a valid value in CSS for the border field, however 10px is.

When typing HTML, it's very helpful about adding closing tags, indenting within tags, etc. If I put my mouse on a tag, it shows me the closing tag.

The "Find Within Project" feature (i.e. project-wide grep) was powerful and friendly.

There was a menu item called "Insert a Method". It just dumped a code snippet at my current cursor location without even bothering to indent it properly. However, the "Insert a Property" menu item was truly helpful. It knew the correct idiom for creating properties (the one where you use locals() and **).

There are a ton of things in the Source menu that don't seem to work yet or at least don't work as I would expect them to.

The Python console is exactly as you might expect. I wonder when the IDEs are going to discover that IPython rules. Seriously, it doesn't matter that the shell is integrated into the IDE. If it isn't IPython, I'm not going to use it. By the way, I hit cntl-d in the shell, and it stopped responding ;)

If you open up a CSS file, you can use the CSS Builder and CSS Preview widgets. The CSS Builder is basically a point-and-click GUI for creating CSS. It's helpful, but not overly intelligent. For instance, I wanted the "margin" to "All" be 1px. It added four separate lines for margin-top, margin-bottom, etc. The CSS Preview widget is indeed helpful, although I'm not sure how well it will work as soon as you start getting multiple CSS files in the mix. Thankfully, Firebug helps out a lot for this problem.

When I closed the CSS file, the CSS Builder and CSS Preview widgets didn't go away as I would have expected them to. This probably suggests something deep about Eclipse's support for "Perspectives" which are sets of widgets useful for the task at hand. (There's a perspective for Python and there's a perspective for HTML and CSS.) Of course, perspectives are one of the things that make Eclipse feel overwhelming to me.

You can "undock" an editor window to put it into a new top-level window. I know Emacs fans are proud of this feature in Emacs.

It's possible to split the editor window to edit multiple files side-by-side. However, I must admit that I couldn't figure out how until I looked in the documentation.

I typed "getenv" and told NetBeans to add the import line. It did it correctly. It even added it to the correct block of imports, but that might have been by coincidence. Personally, I think this feature is overrated. Perhaps it's more critical in Java.

It told me that I was using an undefined variable when I used a global that was defined in another function. It doesn't know that in Python, you only have to use the global keyword if you want to rebind a global. It's not necessary if you merely want to read the value of a global.

In PHP I defined a function called f and then tried to call it. It was not able to autocomplete the name of the function. However, it was able to autocomplete on PHP builtin functions and to give me their parameters.

When I'm typing a multi-line comment in PHP (using "//") and hit enter, it adds "//" at the beginning of the next line. However, it doesn't do that for "#" in Python.

If I remove a colon from the end of a for loop or the end of a def, it doesn't
complain. That's a bit of a bummer since that's by far my most common syntax error.

Installing the PHP plugin was so easy. There was a list of plugins. I picked one and installed it. To be fair, I think this is more complex in Eclipse because Eclipse lets you install plugins from all over the web. In contrast, there are only about 100 different plugins for NetBeans. I'm guessing there are far more for Eclipse. I liked the fact that I could filter the plugins by the term I was looking for (in this case PHP).
I think I'll continue using NetBeans for a while. It's frustrating that it lacks advanced editor features, but that's not as heinous as the stability issues that Komodo Edit seems to suffer from. That's too bad, because Komodo Edit does a lot of things really right.


Michael Foord said…
Wow, nice detailed review. Thanks.
Anonymous said…
If you like vi you should try:

which is a NB plugin which makes the editor act like vi. It also does some things vi doesn't do and doesn't do some things it does, but does a huge amount of those things.
Anonymous said…
Nice thorough review, thanks. I'm pretty well established with my PyDev + subclipse setup but it sounds like PyDev is soon to be eclipsed by NB (pun entirely intended). I'll have to carve off time to test drive NB soon. Does NB have good subversion and git support?
Unknown said…
Cool review.

Komodo also scans code. The 'pre-baked' functionality you refer to is there to make completions better than static parsing is able to do.

Also curious what stability issues you are referring to.

Shane - ActiveState
jjinux said…
> Wow, nice detailed review. Thanks.

Wow, a compliment from the Fuzzyman was worth the eight hours of effort ;)
jjinux said…
> If you like vi you should try:

My jaw just dropped. That's so frickin' awesome!
jjinux said…
> Does NB have good subversion and git support?

I see Subversion, CVS, and Mercurial. I don't see Git either built in or in the plugins list.

Hmm, looks like they're working on it, and it has high priority:
jjinux said…
> Also curious what stability issues you are referring to.

I really like Komodo Edit, but it crashed on me three times within the couple of days I was playing with it. I wrote about that here: It freezed up so badly on my buddy Ben Bangert that he couldn't use it again until he logged out and back in again. I'm not sure how that could possibly be.

I'm using Komodo-Edit-5.0.3-2767-macosx-x86 on Mac OS 10.5.
"There are no Vim or Emacs key bindings."

I managed to set Emacs-alike key bindings on Tools > Options, then select the "Keymap" tab, then select the "Emacs" option on Profile. Then you can also add key combinations for lots of tasks.

"Opening up files is a bit painful."

See Help > Keyboard Shortcuts Card. On the default (NetBeans) keyboard profile, Alt-Shift-O lets you type the part of a filename, and select any source file which matches. Pretty useful.

Kind regards,

Jeff said…
There are more recent builds here: The __future__ imports is fixed, code coverage is working, and quite a few other issues have been eliminated.
Anonymous said…
80 column mark. There seem to be a couple approaches. A nice one is column-marker.el
which provides, e.g.,
C-u 80 M-x column-marker-2
for a cyan highlight at column 80.

Also, auto-indent modes are nice for catching missing colon bugs in python (at least, this is how I usually catch them).
Anonymous said…
Oops, the top of the previous comment should have been:

For those playing along in Emacs,

rectangle select:
C-x rk = kill rectangular region
C-x ry = yank rectangular region
jjinux said…
I wrote about jVi:
jjinux said…
> There are more recent builds here:

That's very strange. When I originally downloaded NetBeans, it was only like 25mb. However, just the Python plugin is something like 50mb.
jjinux said…
> See Help > Keyboard Shortcuts Card.

Great tip. Thanks!
jjinux said…
Actually, a really great way to open files is to type in the name of the function or class you want to change in the quick search field on the top right and then tell it to open the file. I think that's like Spotlight on a Mac.
jjinux said…
> Actually, a really great way to open files is to type in the name of the function or class you want to change in the quick search field on the top right and then tell it to open the file. I think that's like Spotlight on a Mac.

Hmm, that doesn't work for functions :(
Wyatt said…
I've used NB a bit for Java projects and found it to be more "inviting" than Eclipse. After reading this review of NB, I decided to give it a whirl for Python. I'm already using Wing IDE Pro, but it doesn't support languages other than Python well (or really at all beyond syntax highlighting).

An important (crucial really) feature for me is being able to select the Python executable for a project. This feature seems to be missing from Komodo Edit, but it's there in NB. The only problem is, changing the default to a virtualenv executable has caused NB to hang twice. I'm running the latest Ubuntu and Sun Java.

Given that this is an "early access" release of the Python plugin, I guess this is no big deal. Otherwise, NB is looking pretty good for Python/Web development.

OTOH, if I could set a per-project Python in Komodo, I'd probably go with that.
jjinux said…
My feeling is that WingIDE is going to be better for pure Python development. Those guys really know what they're doing. For instance, it's possible to debug a server running on a remote machine with WingIDE. Once you can do that, all the other things you mentioned seem easy in comparison.

Personally, I'm so used to using pdb in a shell that if using NetBeans as a debugger doesn't work out, it's no skin off my back.

Thanks for the comment! It's nice to hear that I'm not the only one who finds NetBeans less overwhelming than Eclipse.
Abdul said…
SCP/SFTP Support

Very good review, buy!
jjinux said…
Wyatt said…
A quick follow up on NB. I'm liking it more and more. Keeping in mind that my baseline is Wing IDE Pro & Komodo Edit, the built-in SVN and database support in NB is very nice.

Also, I'm not sure why I had problems with using a per-project virtualenv Python at home, but it works just fine at work on the same OS.

One thing that bugs me about Wing is the way SVN commit messages can get lost if you click back on an open file. NB pops open a separate window and allows you to easily view diffs of each file, choose files to exclude, etc. Also, the message input is set to 80 cols by default, which is a small feature but a big deal (for me, at least).

Another thing that's handy is being able to connect to various DBs through the IDE. Before, I'd be running Oracle's SQL Developer; now I can stay in the IDE (and it does everything I need it to do so far).

There's a whole lot more. Maybe I should post something on the ol' blog...
jjinux said…
Thanks for the update, Wyatt. If you do decide to blog about it, add a link here so that we'll know to read it :)
jjinux said…
Here's a couple more things I like. When my cursor is over a variable, all the other instances of that variable are also highlighted. That's strangely helpful.

I can right click on a function from the standard library and say "go to declaration" to read more about what it does if I'm unsure of the details.
jjinux said…
I created a retrospective after six months of using NetBeans:
Maria said…
Men's Suit said…
Dude thanks for this post, It help me a lot,thanks for fixing for us.

Popular posts from this blog

Ubuntu 20.04 on a 2015 15" MacBook Pro

I decided to give Ubuntu 20.04 a try on my 2015 15" MacBook Pro. I didn't actually install it; I just live booted from a USB thumb drive which was enough to try out everything I wanted. In summary, it's not perfect, and issues with my camera would prevent me from switching, but given the right hardware, I think it's a really viable option. The first thing I wanted to try was what would happen if I plugged in a non-HiDPI screen given that my laptop has a HiDPI screen. Without sub-pixel scaling, whatever scale rate I picked for one screen would apply to the other. However, once I turned on sub-pixel scaling, I was able to pick different scale rates for the internal and external displays. That looked ok. I tried plugging in and unplugging multiple times, and it didn't crash. I doubt it'd work with my Thunderbolt display at work, but it worked fine for my HDMI displays at home. I even plugged it into my TV, and it stuck to the 100% scaling I picked for the othe

ERNOS: Erlang Networked Operating System

I've been reading Dreaming in Code lately, and I really like it. If you're not a dreamer, you may safely skip the rest of this post ;) In Chapter 10, "Engineers and Artists", Alan Kay, John Backus, and Jaron Lanier really got me thinking. I've also been thinking a lot about Minix 3 , Erlang , and the original Lisp machine . The ideas are beginning to synthesize into something cohesive--more than just the sum of their parts. Now, I'm sure that many of these ideas have already been envisioned within , LLVM , Microsoft's Singularity project, or in some other place that I haven't managed to discover or fully read, but I'm going to blog them anyway. Rather than wax philosophical, let me just dump out some ideas: Start with Minix 3. It's a new microkernel, and it's meant for real use, unlike the original Minix. "This new OS is extremely small, with the part that runs in kernel mode under 4000 lines of executable code.&quo

Haskell or Erlang?

I've coded in both Erlang and Haskell. Erlang is practical, efficient, and useful. It's got a wonderful niche in the distributed world, and it has some real success stories such as CouchDB and Haskell is elegant and beautiful. It's been successful in various programming language competitions. I have some experience in both, but I'm thinking it's time to really commit to learning one of them on a professional level. They both have good books out now, and it's probably time I read one of those books cover to cover. My question is which? Back in 2000, Perl had established a real niche for systems administration, CGI, and text processing. The syntax wasn't exactly beautiful (unless you're into that sort of thing), but it was popular and mature. Python hadn't really become popular, nor did it really have a strong niche (at least as far as I could see). I went with Python because of its elegance, but since then, I've coded both p