IntelliJ for Ajax

Revision as of 22:41, 17 February 2014 by Conrad Damon (talk | contribs) (Created page with "== Thoughts on Using IntelliJ IDEA to Develop Ajax Applications == Since 2007 or so, the Zimbra client team has mostly used IntelliJ IDEA to edit and manage client source cod...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Thoughts on Using IntelliJ IDEA to Develop Ajax Applications

Since 2007 or so, the Zimbra client team has mostly used IntelliJ IDEA to edit and manage client source code. Before that, we tended to use Eclipse. I’m currently on IDEA 13.0.1.

Since this is client code, I’m primarily working in JavaScript, though I also need to write HTML, CSS, JSP and occasional Java code. Like any good IDE, IDEA recognizes all those and has some nice highlighting and syntax checking for each language.

The main drawback of IDEA is its sheer size and complexity. You could spend a week in the preferences alone. Fortunately for me, most of them apply to Java so I don’t need to worry about them. It really does offer a mind-boggling number of options and services. I wouldn’t be surprised if there’s a way to play Tetris inside it. Given its size, it’s a bit of a memory hog. In my environment (MacBook Pro) it currently takes about a gig of memory. A few years ago (while on version 11 I think) I was one of the unfortunate users running into a random indexing loop which would run my machine out of memory and crash IDEA. After hobbling it as much as I could by turning off features and loading much less code, and tweaking some low-level memory allocation settings, I was able to get it to limp along until the problem went away with a subsequent release. That was definitely my low point with IntelliJ.

The intentions, inspections, and other analysis done as you type can get to be a bit much. Fortunately, you can turn off the ones you don’t need in Preferences, once you find them. For the most part, I just want the syntax checking (including brace matching). Fairly recently, the JavaScript plugin has added the ability to recognize the pseudo-OO aspects of the language and can do nice things like take you directly to class definitions, as it does easily in Java.

The panel layout is nice. I can subdivide my editing pane into multiple panes both horizontally and vertically, which is especially useful when combined with a nice big monitor. Typically a have a grid with four editing panes going. You can also add and position various types of “tool windows”, for example one that shows the file system layout. The first of two I almost always have open is the “Structure” view, which shows you a configurable view of the current file’s functions and/or properties. I like to limit that to showing a sorted list of functions so I can jump around easily in the code (in addition to Ctrl-click on a method name within the code). One weakness of the structure view is that it doesn’t understand the popular style where everything is defined in a single anonymous object. Hopefully they’ll add that soon. The other panel I find really useful is “Changes”. That one hooks into whatever source control system you’ve configured. We use Perforce, and I have to say the Perforce integration is very nice. I can easily view diffs, annotations, create/edit changelists, and commit changes within IDEA.

You can also have more than one IDEA window/session open at a time. That’s not something I do a lot, but it’s handy if I’m working on changes to more than one branch of code.

Jump to: navigation, search