 |
New Tricks for Old Dogs
Posted by tball on October 12, 2004 at 12:04 PM | Comments (14)
"You can't teach an old dog new tricks." Like many senior developers (old dogs), I've been quite happy and productive with Emacs or vi. I could use an IDE if absolutely necessary, but since my management pays me to be productive that always meant going back to my core tool set when the pressure was on.
One reason Emacs (and, to a lesser extend, vi) remained such a productive tool is because I could always configure it to support my work environment. It didn't matter what the project language, source control system, or build tool was -- it just worked. It also didn't impose any of its own abstractions on the project, such as proprietary project file types.
"Wait, Tom, your biography says you are working on NetBeans!" That's true, but a couple of years ago I couldn't use it in my daily work, nor could the rest of my project team at the time. We had a short list of reasons why: it was too slow, the GUI was counter-intuitive, the binary project type couldn't be shared, and the code-completion database wasn't useful since we always ran a pre-release JDK. But the NetBeans team made huge strides with performance in 3.5 (and the work continues), 3.6 saw a very slick windowing system update, and 4.0 has an Ant-based open project system I really like.
Still, I did my NetBeans development using Emacs until a few months ago. What changed things was a very small feature you probably won't find in the marketing blurbs: when editing Java source, you can right-click on any identifier (such as getToken in this example) and go to its source, its declaration, or search for its usages in other source files:
"Wait, Emacs can do that!" the diehards might shout, and to a certain extent that's true using its tags facility. But there are two reasons why I have never used tags for day-to-day source editing: tags are not syntax-aware, and the tags file needs to be regenerated to stay in sync with the source. You can regenerate tags files in your build, but I never figured out how the Emacs compile command can be tweaked to notify the tags facility that its database has been updated. I'm sure it's just a small amount of ELisp code, but at the end of the day my managers want working Java code, not ELisp.
NetBeans 4.0 addresses both of these issues. First, it leverages javac to provide a very accurate syntactic and semantic map of source files -- it knows what type of identifier my mouse is clicking on and where the source is that resolves it. Second, every time I start up NetBeans, it rescans all my source and class files to rebuild its repository, so that map never gets out-of-date.
Code completion is another IDE feature I never found useful because the database the IDE used for lookup was always out-of-date. But an accurate, complete mapping becomes very addictive to this old dog, causing me to bring the list up even for methods whose parameter list I am pretty sure of: it takes less than a second to get confirmation I remember it correctly, rather than risk a build error later. Oh, but the NetBeans editor uses javac for its background error checking, so all I have to do is stop typing for half a second and any errors will be underlined in red. What's the problem? Just move the mouse over the underlined area, and the javac error text is displayed as a tooltip:
These two features alone are responsible for cutting the number of my edit/build cycles down significantly. I understand that other Java IDEs have similar capabilities, so I am not claiming that NetBeans is the only answer here. But the features now starting to appear in these tools are leaping past what Emacs and other older editors could ever offer. Pretty GUI tricks may not interest old developer dogs, but simple productivity gains like these make us sit up and notice.
Bookmark blog post: del.icio.us Digg DZone Furl Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment
-
These are both great features, but they've existed in eclipse for some time now. And eclipse doesn't really have that many performance issues (WSAD 5.1.2, anyways).
I guess that's probably heresy for a netbeans developer, but I've developed major projects on both, and my experience with eclipse (WSAD), has been a little better.
I will always have a soft spot in my heart for netbeans though, since it was the first IDE I ever used (it was actually Forte for Java 2.0), so I'm definitely giving 4.0 a try, though.
Posted by: heaththegreat on October 13, 2004 at 06:10 AM
-
Tom, I am quite surprised you just recently caught on to modern IDEs and the features they provide. Netbeans has had these features for quite some time now. I don't know how I'd get along without it. Seems like every Monday I get the chance to play with some new tool or api and I couldn't keep up without code completion, integrated javadoc, and a whole host of other features Netbeans provides.
Posted by: bneuman on October 13, 2004 at 06:23 AM
-
Hrm. I think the only new feature here is the "usages". IIRC, everything else has been in NetBeans since at least 3.5, some even since 3.1.
That said, I've reluctantly made the switch to Eclipse too. It's GUI and projects systems are a cluttered, clunky mess, and it can't handle XML, JSPs, etc... out of the box BUT it has a number of features NetBeans doesn't have yet:
great native controls fidelity (because Swing doesn't have native controls). Don't get me wrong, I love the Swing API and dislike the SWT API, but SWT feels more native (suprisingly, even on OS X)
Eclipse has a nice quick fix for problems
the most common refactorings are missing in NB
NB has nothing like Eclipse's "mark occurences"
The truth is that NetBeans is much better designed IMHO, but Eclipse is a generation ahead.
Posted by: jtr on October 13, 2004 at 06:49 AM
-
I agree Netbeans is getting there. At first I had some trouble seeing the benefits of the new build system (Ant was handled quite well in 3.6 and I liked the mounting feature) but I
Posted by: jmelchio on October 13, 2004 at 08:36 AM
-
Tom, NB 4.0 is a really nice IDE, glad you've picked up on that. Java IDEs, esepcially the free ones, have improved by leaps and bounds and are absolutely worthwhile for many tasks. Text editors with Java stuff tacked on are really starting to lose ground because they lack Java "intelligence". I use syntax-highlighting text editors or vi now and then for "little" jobs where I don't need the IDE loaded, but if I'm in project mode I need all the Java-specific tools and fast easy usability I can get. You mention the code scanning, and while I do like that it's totally up-to-date 98% of the time, it really drags when scanning, and I wonder if it could be done more in the background, especially at startup, instead of putting up a dialog.
jtr, native controls fidelity makes things nice to look at when compared to your native desktop, but it has absolutely nothing to do with productivity. Native controls are also not always the best control available for a particular task. Yes, it looks like the rest of them, but that doesn't inherently make it better. So who cares if it's native or not! Besides, Eclipse's tabs and some other stuff don't feel "native" to me at all. If it's usable and you need to use it a lot, you get used to it. You hit the nail on the head about Eclipse -- it's a "cluttered, clunky mess". I agree it has a few really good features, but the everyday stuff that you use all the time, IMO, isn't polished and usable enough to make me feel more productive. Please expound on it's "nice quick fix for problems" -- that's a totally vague statement that everyone might as well ignore.
Regarding refactorings, I think you mean that NB doesn't have the common refactorings you'd like it to have, because it really does have the most common ones. I agree, it could use more, and they'll come in time or you can get one of the really great plug-ins like http://www.refactorit.com/, which from what I hear is better than the free ones for Eclipse. I actually try not to use refactoring IDE functions too much, as it helps me think about the design more when I do it manually.
If you haven't guessed, after trying out Eclipse 3.? and NB 4.0 Beta, I'm highly leaning towards NB. I just found myself getting really annoyed at Eclipse for all the button-bars, perspective switching, and hotkeys I had to memorize to actually get stuff done. BTW, my trial was with MyEclipse. In the end I just like the usability and clean UI of NB, and that it took me less time to "figure it out". I'll probably go through the exercise of trying out the latest Eclipse every time NB get's to a new point version, though, just to see if things are smoothing out in Eclipse or not.
Posted by: gerryg on October 13, 2004 at 08:47 AM
-
Hey, I wasn't trying to start an Eclipse vs. NetBeans war! :-) My point was that it took a little, under-appreciated (or at least, not trumpeted by marketing) feature to get me over the hump to where I am more productive with NetBeans than Emacs. For each person that feature set may be different, but all Java IDEs are reaching and surpassing tools like Emacs in productivity for even the most hard-core old-timers like myself.
Posted by: tball on October 13, 2004 at 08:48 AM
-
nb4b completely rocks! after spending 2hr w/ it one weekend i eagerly cut over and have not looked back. it's am amazing application.
Posted by: gonzo on October 13, 2004 at 09:19 AM
-
Tom,
Take care of my "search & replace" nit and I
Posted by: johnreynolds on October 13, 2004 at 11:30 AM
-
My oh my... this new blogging system is buggy. It cut off my reply, and if my eyes don't decieve me the comments are not sorted in ascending order.
Posted by: johnreynolds on October 13, 2004 at 11:32 AM
-
I end up using an IDE and Emacs, Obviously the IDEs know lots about Java and Java projects but they unfortunately have poor text editing abilities. Do either of NetBeans or Eclipse support rectangular cuts like C-x r k or macros like C-x ( ...C-x )? That
Posted by: arcturus on October 13, 2004 at 02:55 PM
-
native controls: the look is important for first impressions, but the feel of native controls that's missing. There's a bunch of issues, which are probably well known, like the font size and rendering, missing pixels, etc... Overall, I love the look of NB, but when stuff is missing like the right click popup in text boxes, it frustrates users accustomed to certain behaviors. This is fixable, but it's LOT'S of work to keep it up. Note that Swing is still one my my favorite APIs (see my post on the Mustang suggestions forum for more info).
quick fix: select a red underline and hit ctrl-1. It brings up a menu of things that Eclipse can fix (like add a missing semicolon, paren, add throws to method definition, etc...). There's a bunch of little things like this which NB doesn't have yet.
refactorings: extract method, which IMHO is the most useful refactoring is missing from NB.
Posted by: jtr on October 13, 2004 at 05:40 PM
-
Are you kidding? It's 2004 for God's sake. You won't find that 'little feature' in the marketing blurb, because ALL modern IDE's do that, and have for years. You probably shouldn't use Intellij IDEA -- you might faint.
Posted by: fijimf on October 14, 2004 at 05:22 PM
-
I didn't faint, but I did uninstall it after a couple of weeks even though it is an excellent product. The same thing happened to all the other Java IDEs I've tried over the past nine years since Visual Cafe made its entrance. When the crunch is on during a release cycle, it's all about delivering high-quality code quickly, and I personally could deliver better with Emacs. Other people's mileage can, and did vary from mine.
If you re-read my entry, you'll see it's about how I got over this productivity hump using the latest NetBeans release and in the process discovered a couple of tiny producitivity boosters. It was not about new features in NetBeans which has had these features for years.
I just couldn't use them because I couldn't use it before.
I'm not a NetBeans booster, just a long-time Java developer always looking for better tools and sharing what I find in this blog.
Posted by: tball on October 14, 2004 at 06:49 PM
-
Hi,
Just to be fair, all the features that you claim are missing in Emacs are actually implemented by the JDEE (Java Development for Emacs) and its plugins and add-ons - without relying on tags.
You can have your code completion help, reference and definition finding, even have your errors highlighted on the fly (thanks to the flymake integration).
Unfortunately, refactorings are not (yet) supported.
Posted by: nascif on October 14, 2004 at 11:07 PM
|