My first day with IntelliJ IDEA

For years I’ve heard the IntelliJ fanclub speak of how great this IDE is, all the while I’ve been quite happy using Eclipse. Besides, I couldn’t see spending $250 or so for an IDE that I can get for free.

Well, a couple days ago we started on our site rewrite and we are going to use Java to replace the Perl codebase. Most of the current Java developers are quite familiar with Eclipse but the existing Perl guys weren’t warming up to it too much. Anyway one of the guys is an avid IntelliJ fan so we started discussing the pros and cons of each. Everything that was a ‘pro’ for IDEA was a pro back when Eclipse wasn’t all that great. Things like the diff tool, refactoring, customization and a few others. However we didn’t get into the discussion as a religious debate and we, including me, decided to give it a shot for month to see if it was really worth while.

The Install

Pretty straightforward to say the least. No issues with that.

Customizing

So far I can pretty much do what I want to when it comes to customizing, at least to match my Eclipse 3.3 install. The one thing so far that I don’t like is the way it flags changes to files that then need to be synched with SVN. It uses color coding on the files when isn’t the most obvious indicator. I like how in both Subclipse and Subversive I can completely customize that aspect. I also like how I can, in Eclipse, tell it to show the rev#, date of change, etc. I haven’t yet found a way to do that in IDEA.

Code Formatting

The code formatting feature I can’t find in IDEA is aligning class member variables. Everything else I could do that I can in Eclipse. The one thing I didn’t like is that exporting doesn’t really export like you think it would. I had to go looking around my file system for that file. Import also doesn’t mean ‘import from a file’. That doesn’t make sense at all.

Content Assist
I prefer how content assist works in Eclipse, where a Ctrl-Space does both imports as well as method params. In IDEA, after changing the kep maps, imports are still done via Alt-Enter. I like the Ctrl-Space as it is one handed and doesn’t interrupt the flow of typing as much. Maybe I missed it but I haven’t seen where I can change that in IDEA.

Plugins

Eclipse obviously wins here with the vast number of plugins available, but I found that for what I need IDEA either has it built in or has an equivalent plugin.

Editor

The default editor in both IDEs is quite capable and pretty similar in features. The one feature I do NOT like in EITHER IDE is the code folding isn’t capable enough. It will fold a method, but won’t fold anything deeper than that. Eclipse does have a plugin by Coffee-Bytes that allows deeper levels of folding and is wonderful, especially on XML/JSP/HTML, etc.

Misc

I miss the right-click > Run As menu that Eclipse has. This is great for running single unit tests. I do like that TestNG is included in IDEA 7.

Ant - The ant plugin on Eclipse 3.3 is horribly broken. Try opening or saving an Ant file and you are in for a long wait. This occured on both the PC and Mac versions. Not acceptable and can’t believe it was released like this. I do like how IDEAs output of the ant build is structured, how it folds each target that was executed. Pretty nice.

Server Integration - I hate that Eclipse has used the IBM/RAD approach to setting up servers. Having servers as a project is just a stupid concept. I prefer the old Eclipse way of doing it. I haven’t tried this in IDEA yet, and honestly haven’t seen where to do it, but it is only day one :)

Day One Conclusion

So far I see nothing that says this is worth $250. The SVN visuals are not great either. If their new feature list comprises of integrating Hibernate and Spring I’m not impressed. However I’m keeping an open mind and will use it for the whole trial period. Hopefully I’ll find that killer feature (no refactoring isn’t it) that really compels me to switch. The Groovy and Ruby support is interesting and I look forward to playing with it. Of course I can use both on Eclipse as well…

I will say however that Eclipse 3.3 has been very unreliable on my PC at work and I definitely wasn’t happy about that. It would crash a couple times a day and I’ve never had that problem with previous versions. So it will be fun to see what the next 29 days brings…



Don’t miss anything, subscribe!

Did you enjoy this post? Why not leave a comment below and continue the conversation, or subscribe to my feed and get articles like this delivered automatically to your feed reader.

Comments

I haven’t used Eclipse - you haven’t yet used the features that make IDEA great: intentions and refactoring. Play around with the Refactor and Code menus. Also, pay attention to the light bulbs that appear with intention suggestions.

IDEA is to Java IDEs as Mac OS X is to operating systems

Jordan: I have noticed the little bulbs. I’ve read about the intentions but haven’t yet seen their benefit. I’m sure I will however.

i think IDEA provides more stuff than Eclipse out of the box. it’s xml, javascript, html and css support is better then others. IMO, one of the real value of IDEA is that it’s general feel-design of the application. Bu to see this, you need to use it extensively. And if you get used to Eclipse, this may take a very long time. Still, functionality wise, i guess they are on par with Eclipse, the devil is in the detail..

Last time I saw IntelliJ (more than three years ago, I think) it’s shift ctrl space feature was awesome. It gives context help based on types and visible variable names, and can write entire lines of code just keeping it pressed. I found it much superior to the eclipse equivalent.

As of eclipse server integration, you can configure your project as a plain java app, though you must do it by hand :(

Hi,

In my opinion, one of the main advantage of IDEA, is when working in a team, and integrating TeamCity ( also a plugin you would have to pay for ) you can really have a dynamic team work. It’s great for a lot of reasons.

If you don’t plan on using this, you very well might want to stick with Eclipse, which offers a large list of plugins.

In the end, I’ll say the same : getting used to Eclipse, you can do everything IDEA does. For free. So I see no reason for paying 250$ !

Cheers
K

PS : /!\ TROLL ALERT /!\ : what about Netbeans ? :D

For the Eclipse -> Run as menu, put your cursor anywhere in the test method you want to run and do Control-Shift-F10

OK, I like the ctrl-shit-f10, thanks Rob!

Netbeans? hmm… haven’t looked at that one since before Sun bought it.

My favoriate IDEA commands are ctrl shift n and ctrl alt shift n

for exampele ctrl shift n, then typeping PDI, would list, PersonDaoImpl. I shudder when I see developers using their mouse to navigate a giant tree of source files, when there are keystrokes that could be used to open the file. In eclipse, I believe they call it Open Resource.

ctrl shift n. Use it.

I’ve been attempting to give IDEA a try, but it’s really, really hard to have to learn all new ways of doing things after using Eclipse for years. I can’t really take the productivity hit while I’m working on a project. It’s that inertia that makes a switch really hard.

Mike: I rather like that feature myself. Pretty handy.

Dan: I know what you mean. I’ve been using Eclipse pretty much since it first came out, but it isn’t too bad switching to IDEA. The first thing I did was switch the keymap to Eclipse which helped out a lot.

I have visited Eclipse a couple of times but keep going back to IntelliJ for most of the same reasons. Eclipse looks so awesome on paper with all the plans and plugins. The problem is none of them work as advertised. Also Eclipse goes out to lunch once a day (or more) on me and I’m like “what is is doing?”.

I am much more productive with IntelliJ. I probably save about two or more hours a day using it over Eclipse.

Also my fingers are trained to use vim. I really rock with vim. There are none faster. The vi plugin is free on IntelliJ but on Eclipse it is $15 - $20. I actually paid for it and bought it but it does not work. A plugin I paid for on Eclipse is broken (as are 98% of the free ones).

> Netbeans? hmm… haven’t looked at that one since before Sun bought it.

A lot of things have changed since that time… I recommend giving NetBeans 6 a try. After all it’s free and the recent reviews are very good.

Don’t forget Ctrl Alt H on something you want to find usages on. I almost use that more than Alt F7 (the normal find usages command).

Ctrl Alt F7 is a new quick find usages that pops up in a window, they put that into Idea 7, I haven’t used it much yet.

I don’t know what the Run As command does in Eclipse, but if you want to run a unit test in Idea, open up the test file, right click on either the class name or a test method and choose Run or Debug, it will run it as a JUnit or TestNG test.

If you want a free IDE, eclipse is fine, but if you have the $250 available for the IDE, I don’t see a reason NOT to use Idea.

Granted, it is easy for me to say since my company sports the bill, but the refactoring alone is worth the cost. The only people who I have seen have as good of functionality as Idea are people who BUY the plugin for MyEclipse. So, pay one way or another, I would rather pay a little more and get a LOT for the money.

If money IS an object, sure, use Eclipse. It is similar to comparing the free more robust text editors vs someone using textmate. Yeah, you can get a lot of the same functionality for free, but when you have a little money to spare, why not upgrade? :)

You’re giving it 30 days. I think that’s a fair shot and by then you should start picking up on how intuitive Idea can be. Good luck!

@Jordan: Eclipse already have “intentions”. Press ctrl 1 and you will see that. Anyway, IDEA has more intentions than Eclipse.

@Mike: Eclipse also has type search (ctrl shift t) and resource search (ctrl shift r). When using type search, you could write camel case too, but on research you can’t, even if resource is a java class.

Things that I like more in Eclipse:

1. ctrl space is a unified way to code completion. You don’t need ctrl j (live templates) and ctrl shift enter for smart completion. Just type ctrl space and everything is going on.
2. Control version tools in Eclipse are more user friendly, specially because it does not appear in another window but on another perspective. The window where you see differ is more accessible (double click or enter instead of shortcut or rigth click and menu).
3. Eclipse has a “X” on any opened file that provides good usability than ctrl f4.
4. Incremental Compiler

Things that I like more in IDEA:

1. Groovy, Ruby, Maven support are professional.
2. Has a ton of code inspections out of the box.
3. Code coverage out of the box.

PS.: I am using IDEA under trial too, so I must learn the tricks.

@Jordan: Eclipse already have “intentions”. Press ctrl 1 and you will see that. Anyway, IDEA has more intentions than Eclipse.

@Mike: Eclipse also has type search (ctrl shift t) and resource search (ctrl shift r). On type search, you could use camel case too, but on research you can’t even if resource is a java class.

Things that I like more in Eclipse:

1. ctrl space is a unified way to code completion. You don’t need ctrl j (live templates) and ctrl shift enter for smart completion. Just type ctrl space and everything is going on.
2. Control version tools in Eclipse are more user friendly, specially because it does not appear in another window but on another perspective. The window where you see differ is more accessible (double click or enter instead of shortcut or rigth click and menu).
3. Eclipse has a “X” on any opened file that provides good usability than ctrl f4.
4. Incremental Compiler

Things that I like more in IDEA:

1. Groovy, Ruby, Maven support are professional.
2. Has a ton of code inspections out of the box.
3. Code coverage out of the box.

PS.: I am using IDEA under trial too, so I must learn the tricks.

IntelliJ is far superior than Eclipse. Of course you will find it difficult to adjust to new keystrokes after working on Eclipse for such a long time- however, I could say the same :-) I used IntelliJ for a very long time and then was forced to switch to Eclipse and I just don’t get it. In face I hate it so much I decided to use Netbeans because I can’s afford $250.
IntelliJ is truly intelligent and makes your development so much easier.

I know a lot of developers swear by Eclipse but it just doesn’t do the trick for me. I’ve been using Netbeans (get Netbeans 6.0 beta!!) and I’ve been very, very happy with it. IT’s definitly worth a look.

I used to use IDEA quite a bit; but it was missing some features I needed (e.g. Maven integration) The latest version of IDEA, 7.0, finally has good Maven integration AND as a nice bonus it supports Groovy/Grails projects.

Good idea to take a look on an other IDE. But to really understand the power of Idea it is necessary to use it in its way. So I suggest not to change the key map - instead try to learn the shortcuts the Idea developers have chosen.

For your second day (or third) I suggest to try smart code complition (Shift-Ctrl-Space). I use it a lot and it really saves a lot of typing…

Well, this one day analysis is certainly a little biased. I am in a vice versa situation, where I am now evaluating Eclipse (actually the MyEclipse distribution) as an IntelliJ user.

My conclusion is the opposite, IJ is very well worth the 250$ because it is simpler to comprehend, to set up, and to use.

- The refactorings in IJ are more thorough
- The user interface is simpler and less cluttered (I find the perspective metapher in Eclipse rather confusing).

Eclipse misses some simple base functionality, which I considered self understanding: printing with line numbering (not possible currently - which drove me nuts) and only one single tab row, which is very inconvenient.

However, if you come from one IDE the other will always look awkward at first glance. So it would be better, had the author given himself more time to get familiar with IJ, before posting.

Kind regards

Thomas

You using Spring?

If you are, IDEA 7 w/ Spring rocks. CTRL plus clicking on a bean name you can get to the class. When you are writing bean ref’s in your xml config files, you can ALT Enter and create the setter in your POJO. As well, you can intellisense / code complete in your XML file!

IDEA just makes the mundane stuff easy, and let’s you get on w/ the important stuff

Folding in Intellij:

There is a whole folding menu under view. You can fold any code block (not just methods) by placing your cursor within it followed by ctrl-shift-period.

But also, you can select a few lines, which don’t have to be a complete block - and can even span blocks - and do ctrl-period which creates a fold over just those lines.

You can also even select within a single line and fold the selection there.

I recently tried IntelliJ 7.0.1. I gave up on it after 10 minutes or so.

I created a project from existing sources. All appeared well - all the files showed up on the left. However I could not open any files. I thought simply double clicking the files in the left “project” pane would open them - coming from years of using just about every other editor out there :) I was confused for a bit, then I noticed the ‘navigation bar’ would change slightly when I “single” or “double” clicked on any of the files.

Finally I found out that I had to single or double click the file in the project pane and then double click the file in the navigation bar. I opened a few that way, then I wanted to close them. I looked on the tabs for the close button but did not see any, so I figured the big X on the right must close the current tab like previous versions of firefox. Oh great it just closed the navigation bar - the only way I knew how to “open” the files! Luckily, turning the navigation bar back on was right where I expected it.

What a pain.. I began looking around for an option to change the behavior so that I could double click a file in the project pane to open it. Then I figured it must be a bug… it can’t be the default behavior. After clicking all of the small buttons in the project pane it magically starting working. After ~10 minutes of using the IDE I was finally able to open files normally, but what worries me is I wasn’t sure how the IDE got into that state and I had no idea how I fixed it. It didn’t exactly give me a warm fuzzy feeling about the IDE, but I’m willing to give it another chance. Another thing I didn’t like was the startup time - it seemed much longer than NetBeans 6, and once it was loaded it took even longer to load my one open project. The other things are related to the L&F. NetBeans looks alot more native and the text is much easier to read IMHO (but it may just be because I’m used to NetBeans).

I haven’t actually written any code using IDEA yet. One of these days I’ll give it another shot.

@Marcos: I too like the incremental compiler.

@Steve: That is a surely complicated way to get the folding, but I’ll give it a shot. Nothing beats jEdit when it comes to folding…

@Thomas: I did say it was only the first day :). The perspectives can be confusing, but honestly I never leave the Java one, even when doing web apps, with the very infrequent use of the SVN perspective (you don’t need to use it when committing or updating).

@the dooder: I don’t work on a Mac for TextMate, but one of the guys at work is going that route. I have, on occasion, just used jEdit with the appropriate plugins. A very nice tool, and talk about light-weight!

Website Templates and Web Design, Graphic Layouts…

Sorry, it just sounds like a crazy idea for me :)…

Business Ideas Forum…

I couldn’t understand some parts of this article, but it sounds interesting…

Computer Maintenance Tips…

I couldn’t understand some parts of this article, but it sounds interesting…

How To Start A Blog…

I couldn’t understand some parts of this article, but it sounds interesting…

In regards to the double clicking in IDEA the reason why it’s hard to open files by double clicking is that Java programs e.g. IDEA reads the double click speed from X11 resources. If it is not explicitly set then it defaults to 200 ms which is lightning fast.

In order to have a more sane threshold create ~/.Xresources and add:

*.multiClickSpeed: 400

Web Site Design…

I couldn’t understand some parts of this article, but it sounds interesting…

Ctrl-Alt-Space will allow you to code complete on classes in your classpath, and it will import whatever you want to pull in.

Also Eclipse is way to mouse intensive. Searching for everything that implements an interface is such a pain. Ctrl-Alt-b allows you to jump to everything that implements an interface, abstract class, or subclass. You don’t have to navigate to the class definition which is such a time saver just move the mouse of the name of the class anywhere (Variable Definition, Class implementer, anywhere). But, if you do a quick Ctrl=b will take you there.

Opening a class from the keyboard Ctrl n and start typing. Eclipse has three crappy boxes that you have to tab between. If you have classes or files with the same name just use the arrow keys. That’s one of the biggest pains in Eclipse.

Ctrl Shift n and open any file in your project just by typing the name.

Ctrl i for implement methods, Ctr o for overiding.

Alt Insert and generate getters, setters, constructors, equals and hashcode quickly.

Spring Ctrl space in XML files (like Spring), and you can do auto completion on class names so quickly for Spring files, web.xml, etc.

The eclipse debugger is lame. Intellij has code sense built into the evaluation. Watches are lame, but Intellij can evaluate any expression you want on demand (Atl-F8). Can’t remember a name hit Ctrl-Space to explore an instance’s methods, variables, etc. It’s like working with Ruby or Python doing exploratory programming.

Atl-F7 quickly find any usages in your project. Ctrl Shift-F7 highlight usages in the file. Highlight a string before hitting the keystroke and it will find all string expressions in the file. Ctrl l and you can jump between all of your results.

Ctrl Alt L to quickly reformat any code, xml, html, javascript.

Those are just some of the features I use all the time. I’m having to use Eclipse and I hate it. I’m at least 5x slower with Eclipse, and the power just isn’t there.

“*.multiClickSpeed: 400″ must be “*.multiClickTime: 400″

Relative to IDEA, Eclipse is an unstable mess. The preferences window alone speaks to the absurdity of its design. Not to mention the dependency mechanism for plugins. SVN integration? Maven integration?

Eclipse does a lot of things poorly and few of them well, as befits the “focus” of its community.

Leave a comment

(required)

(required)