What the X is XQuery?
XQuery has been gaining momentum over the last year and looks like it will become a very important technology to server-side Java programmers, and probably all back-end programmers really. I've gotten into it big time over the last year and have found it fun and productive, and it's only getting better as the spec gets solidified and vendors start having robust implementations. If you'd like to get up to speed yourself, check out an article I wrote in Oracle Magazine that just went live titled "X is for XQuery".
Posted by Jason Hunter at 09:47 PM
Updated ISP Listings
I added and updated several dozen ISP listings tonight. To those who submitted the ISPs, please come back and add reviews. I know the reviews have meant a lot to people shopping for ISPs.
Posted by Jason Hunter at 02:48 AM
Why I stopped using vim and started using IntelliJ
The other day over pizza and in between getting flirted with by the waitress (I swear, I'm not making this up) my friend Brian asked me what IDE I used. I answered quickly since I'd heard the question a thousand times before: "vim".
I explained I didn't like IDEs because they went after the non-expert programmer, someone who doesn't really know what's going on in their code and doesn't care so long as the IDE has enough wizards to "do the coding for you". I really prefer to code things myself, thank you very much. I'm better at it.
Brian said he felt the same way, but IntelliJ IDEA had changed his mind. It's a "Programmer's IDE". He showed me a demo. I expected a 15 minute overview, but instead he kept showing me feature after feature for about 2 hours. I think he enjoyed it as much as I did, the way a guy with a new sports car enjoys taking people for a ride. I was sold.
After playing with IntelliJ for a day and now using it for real this last week, I'm in love. I'm telling my friends about it. I'm telling you about it! And I find I'm acting just like Brian; I start to talk about just this One Cool Thing and end up listing ten.
Here's the reason I like IntelliJ: It increases your productivity not with crazy wizards that do a half-assed job but by speeding up the various drudge work we programmers have to do (renaming, finding, moving, refactoring, finding compile errors, finding bugs, etc). It lets you concentrate on the Real Work of design and implementation. You spend more time thinking, less time organizing and looking things up.
Now, to be fair, I haven't tried NetBeans or Eclipse. I probably should -- especially since they're free and IntelliJ costs $500 for a single license -- but thus far I'm still on the honeymoon with IntelliJ and am not ready to "cheat". My most recent IDE experience was VisualStudio.NET.
Here's my Top 10 favorite features in IntelliJ, ones that made me say "neat" when I saw them. OK, there's 17. I told you I get carried away.
- It's written in Java but has a more slick and responsive UI than even VS.NET. I like that it doesn't clutter the screen with 1,000 buttons like some IDEs. Sure it does everything, but it doesn't need a button advertising every last feature.
- It knows the Java code structure and makes full use of it. Hit Ctrl-W and it'll select the "thing" you've on, where "thing" is defined by the Java syntax. Hit Ctrl-W again and it'll select the wider thing. Keep hitting until you've selected the right amount. Go from word to string argument to method call to for loop to method to class to file. It's smarter than editors without knowledge about Java's syntax that get confused by characters in comments and such.
- It has the best code-complete I've seen. Microsoft got a lot of credit for IntelliSense in VS.NET, but IntelliJ's is more comprehensive and less intrusive.
- It has quick-pop Javadocs. Hit Ctrl-Q on anything and it gives you a Javadoc pop-up summary. It's way faster than jumping to a browser, and you don't have to shift focus. Start typing and it goes away.
- It has an elegant multi-file search ability. The search can be plain or regexp, and the results appear in a well-designed tree view at the bottom. This beats "grep" anyday.
- It maintains a local Version Control System (VCS) so you can diff your current code against the code from an hour ago, and see a GUI diff. Even though all my code lives in CVS or Perforce, I don't always want to share publicly my personal code checkpoints. With IntelliJ I don't have to copy off Foo.java.safe files in case the new experimentation goes nowhere.
- It makes setting up a project easy, at least compared to VS.NET. I don't know why project setup can't always be this easy. I really like how it lets you have your source, build, and metadata files in different areas. It makes no assumptions and imposes no restrictions. It's a dream versus VS.NET.
- It lets you "temporarily" add a file to a project. One time I was coding some reflection in this isolated class and since I don't do reflection often I wanted IntelliJ's help in prompting me with the getMethod() and invoke() signatures. I just "temporarily" added it to another project. No muss, no fuss.
- It has full featured code auto-formatting and highlighting with toggles to easily produce your own style. It even has an option for how multi-line argument lists should be indented! You can assign different styles to different projects (I have one style for JDOM, one for books, one for personal, and so on). VS.NET has this, but you have to use the Microsoft style. I don't like the Microsoft style.
- There's tons of support for refactoring. For example, if you're going to rename a variable or method, it'll help you by pointing out where it's used and letting you change all usages together. It goes way beyond that of course.
- It shows compile errors inline. Not after a compile like VS.NET, but immediately as you type, including Javadoc @param name mismatches which really plague me. It even marks errors and warnings on the right with little colored dashes in a "gutter" area so you can easily find every issue in a given file. When I write code calling a method I haven't written yet, it marks it in red. When I'm ready to implement the method, I just click on the method and select "implement this method" and it pops a new skeleton method in the right spot, opening the other class if necessary. Saves lots of typing.
- It provides "lightbulb help" where you can have it fix the errors it sees. If a cast is illegal, if a throws is required, or whatever you just highlight the "fix" you want and it's done.
- It's smart about Apache Ant. Normally making builds work is a pain or IDEs tie you to their system, but here I just pointed at my JDOM build.xml file and that was it. It gave me a target list and I hit the target I want. If you want to edit the build.xml file you'll notice IntelliJ is smart about XML editing too. If you have a DTD or schema it enforces it. If not, it infers the DTD or schema from the file you have thus far and lets you auto-complete element and attribute names and such.
- For those times when you want to edit a file externally (I'm not getting rid of vim afterall) IntelliJ makes it easy. It saves files when it loses focus and loads them back when it gains focus.
- Of course there's standard debugging support, with all the goodies like conditional breakpoints. I haven't found any special features here, but getting things going was easier than VS.NET.
- There's a Java-based plug-in architecture so if there's a feature you want you can add it. The CVS support is built-in but I often use Perforce, so I can add the Perforce plug-in. The Javadoc word wrap plug-in is among my favorites. It keeps the asterisks in all the right spots.
- And of course, there's a keyboard shortcut for absolutely everything. I'm not expert enough to know most of them yet, but I'm glad that over time using IntelliJ will be like using vim -- where I don't remember what key does what but my fingers know and just make it happen.
There's a few features missing (i.e. viewing multiple files at once, coming in version 3.5) and it's a memory hog, but it's already become my editor of choice. If you'd told me two weeks ago that I'd leave vim I'd have thought you crazy. But it happened.
Have some experience with NetBeans or Eclipse? Write in!
Posted by Jason Hunter at 06:18 PM
JDOM in the Real World
The March/April issue of Oracle Magazine has a new "JDOM in the Real World" article showing how I use JDOM to manage the RSS feeds on Servlets.com, including how I get this entry to show up on the front page.
Posted by Jason Hunter at 01:12 PM
What's New in Servlet 2.4
The top story on JavaWorld is one of mine, covering what's changed between Servlet API 2.3 and 2.4. Enjoy!
Posted by Jason Hunter at 11:14 AM