Galder’s Passionate Blog

What's the point of living if you can't love or hate?

How IntelliJ IDEA Won Me Over

It’s almost a year since I stopped using Eclipse as my main Java IDE and started using IntelliJ IDEA instead. Ever since I’ve been meaning to write this post and finally I found the motivation after reading Manuel’s reasons on why IntellIJ rocks. I think he makes some valid points, but in my opinion, it misses some other key differentiators. Here’s my list of reasons why IntelliJ really kicks ass as opposed to Eclipse:

IntelliJ differentiates between test and main folders

This is in my opinion one of the biggest advantages of IntelliJ, because it means I can search for references to a class/method within the testing scope or within the production code. Why is this useful? Let me give you two examples:

  • Imagine you want to find out if a method is actually used in production code. Sure, it might be used 1000 times in testing, but is it actually used in production code? Go and figure out from those 1000 references whether any comes from production code.
  • Imagine you want to figure out how to test a particular class. With IntelliJ, you can find references to that class only within the test code, giving you a clear view of how this class might get tested. With Eclipse, if the class is used plenty of times in the production code, separating between testing and production code can be a PITA.

IntelliJ supports running individual test methods better

Eclipse used to drive me nuts whenever I want to execute a particular test method. First of all, it wasn’t intuitive, you had to go to the class overview panel to be able to do so. On the contrary, with IntelliJ you can do so directly from the class code which is much easier. But the most annoying thing about Eclipse was when you wanted to run individual test methods that are defined in super classes. Eclipse could not do this. If you went to parent class and selected the method, it would try to instantiate the parent class but not the child. IntelliJ does this very well, allowing to select the class and then the test method in the run configuration. Eclipse, at least a year ago, was not able to do so.

IntelliJ is the king of refactoring

Refactoring in IntelliJ is taken to limits where Eclipse has never reached. For example with Eclipse, whenever I renamed a test class, I always had to go and change the run configuration. Not any more with IntelliJ.

IntelliJ can shelve changes

A year ago I was not fully using Git yet, and so finding the ability of shelve changes on Subversion projects was really useful. Eclipse could not do this. With Git now, git-stash already does this job, so this feature is not as important this days if you’re coding in Git.

With IntelliJ you can define default VM parameters for all tests

In Eclipse, this is not possible. The only thing you can really do is define default parameters at JRE level, which can be too far reaching if you’re running different type of applications from the IDE.

IntelliJ provides plugins via a central repository

IntelliJ has always had a single place from which you install plugins, which makes it nice, easy and quick to install plugins. This might be a bit outdated now but with Eclipse, in the past at least, you had to go and set up individual plugin update sites in order to install plugins, and this used to be quite a PITA.


Tagged as , + Categorized as Random

26 Comments

  1. Good article. I agree IntelliJ is awesome. The search feature is really cool.

  2. At workplace, we use IntelliJ (a bit older version). But still, the IDE impresses me with the tons of features it provides. For example, it detects even the JavaScript objects in my JSP code and gives code completion.

    A perfect IDE for a hardcore developer.

  3. Iman Reihanian says:

    I accept some above point, but Eclipse is open source and supports a lot of plugin that IDEA can’t support, as well as Eclipse is very good choice to work with other open source framework.

  4. Hey man,

    Have you ever tried Maven? I tell you that 99.9% of your considerations could be achieved using Maven, turning you project IDE Free. :P

    []‘s,

    Renan Viegas
    http://blog.renanviegas.com.br

  5. @Veera, indeed. Same thing happens with Python now. The code completion and debugging is awesome too! I haven’t used PyDev much but it’d be interesting to hear other’s thoughts at the Python development level.

  6. @Iman, could you give examples of those plugins? The Git plugin for Eclipse used to be pretty crap when I tried it about 1-1.5 years ago. It used to slow down Eclipse massively due to continuous scanning. It’ll probably has improved by now, but I don’t use Git plugin for IntelliJ that much. Most Git I do it from command line.

  7. @Renan, Yeah, I use Maven but I still need an IDE. Maven is just a build tool and as far as I know, it does not do auto completion ;)

  8. Dennis Doubleday says:

    Not too impressed by the claim about separation of test and production code. If I search for matches in Eclipse, and the matches only show up in the test directory, that is a pretty good indicator :-)

  9. @Galder, nice article. Couldn’t agree more.

    @Iman IntelliJ Idea has been open sourced about a year ago: http://blogs.jetbrains.com/idea/2009/10/intellij-idea-open-sourced/

    @Renan Idea smoothly integrates with maven (actually, you can open project by double click on .pom file). You can even view maven dependencies graph: http://www.jetbrains.com/idea/features/ant_maven.html (I wonder what for will anyone use it?)
    But still, even if you using maven for dependency and build process management, don’t you need autocompletition, refactoring, code highlighting? :)

  10. There is no problems to create as many source directories as necessary in Eclipse and use some of them for tests. With Maven plugin you’ll get this automatically.

    Adding MoreUnit plugin will solve all things related to unit tests, from automatic refactoring to navigation between test and production code (at method level precision, if unit tests are written at per-method basis).

    Current version of Git plugin is pretty usable (I’m using it every day for one of my projects).

    As for running individual test methods, I see nothing complex in clicking RMB on method (anywhere – in code, in uni test view, in package explorer, etc.) and choosing Run As->JUnit test. As well I see no problems to tune JVM parameters in run/debug configuration which is automatically created (for those, who is, like me, lazy enough to create it manually) when test is at least once is executed using method described above. Not just for all tests, but for single test or even single method.

    Eclipse Marketplace client bundled with recent version of Eclipse serves as a common source for all plugins.

    Shelving/unshelving local changes is convenient, but, depending on the use case, it can be achieved by local history or by VCS. In heavy cases shelving/unshelving does not help anyway. Under ‘heavy’ I mean changes which were written for state before significant refactoring when many classes were moved/renamed/etc.

    And, finally, Eclipse still has far more responsible flexible UI (perspectives, working sets, to name few), rock solid debugger and unbeatable javadoc formatter :)

  11. @Dennis, clearly that’s not the use case I’m referring to. Once you start working in bigger projects, such as an application server, you’ll find yourself with plenty of refs to class/methods spread between main and test code.

    One extra thing that IntelliJ does is that it can search for refs within the project itself, but also within project and their libraries. This can be useful as well but I think Eclipse could do a similar thing, cant’ remember of the top of my head.

  12. @Alexander Ulizko article would be good if it did show more real Eclipse disadvantages rather than lack of knowledge of Eclipse :) Actually Eclipse has disadvantages, but virtually none of them listed above.

  13. @es, thanks for the very thorough reply. Welcome to hear about MoreUnit plugin, it sounds like a very useful plugin for the Eclipse community. They should include in Eclipse by default.

    I must say that I was using TestNG and not JUnit for unit testing and wonder whether, the capabilities might not have been the same when it comes to running individual test methods. I’m pretty sure that at least with 3.6 and TestNG, you could not select a method for individual testing except from the class method overview panel. The parent class definition of test was problematic too.

    I had heard rumours of Eclipse Marketplace, good to see it’s reality now. It’s a good move by Eclipse.

    Flexible UI is not something that’s a killer feature for me in favour of Eclipse. Working sets exist in IntelliJ (Change Sets) and hardly used perspectives myself.

  14. @es, I think your last comment is way out of line. I have used Eclipse for almost 7 years and you can’t consider anything I said as ignorant. When I moved to IntelliJ (again a year ago!), I made a list of things that stroke me as being better done in IntelliJ. Some of them might not be relevant any more, so if anything you can consider them out of date.

  15. @Galder, MoreUnit supports TestNG as well (so navigation and refactoring will still work). I’ve just checked TestNG plugin and found no differences – RMB on test method anywhere (package explorer, TestNG results pane, class outline) shows Run As -> TestNG test menu and clicking on it creates appropriate run configuration and runs test(s). Not checked parent class tests. I’ve tried 3.6 with current TestNG plugin.

    Change Sets in IDEA is different thing and don’t match Working Sets in Eclipse.

    As for UI, I disagree. At work I have couple of monitors one of which contains main Eclipse window with package and project expllorers, source code window and small window with must frequently used views such as search. In separate window at second monitor I have lost of views which are most convenient with enough space – consoles, JUnit view and so on. All of them grouped into single tabbed window and each view is activated automatically activated depending on my activity. Even latest IDEA 10.0 unable to provide such a simple and extremely convenient layout. IDEAs’ detached windows which floating over window look like a bad joke rather than something really useful. Eclipse perspectives extend UI flexibility even further by allowing to change entire layot for some special kinds of activities such a debugging or synchronization with VCS. I think you’ll agree that every such an activity is best done in properly configured layout dedicated to this particular activity.

  16. @Galder, sorry, I didn’t mean to be rude. I just did mean that almost all things listed above are out of date and don’t reflect current state. Hope you’ll agree, that comparison of different IDE’s makes sense only for current versions. As for experience, I must admit that often it does not mean good knowledge of IDE. I’m using Eclipse for almost 6 years, but still see new convenient things here and there. For example, recently I’ve discovered for AnyEdit Tools plugin, which (beside many other goodies) adds Compare To Clipboard, Compare To Opened Editor, Compare To Workplace File and Compare To External File items to Compare menu. First item also exists in IDEA, but I found no IDEA counterparts for others. This plugin exists for more time than I’m using Eclipse at all (first versions were for some 3.0 milestone) and mentioned above feature exists for more than 2.5 years. As you can see, long experience and good knowledge are not the same…

  17. But that’s part of the problem of Eclipse. You don’t know what you have until you find the right plugin whereas with IntelliJ all the right things seem to be there.

    In terms of the UI and your set up, you’re probably right.

  18. Definitely – large number of plugins which, sometimes do same thing (for example, there are two almost identical SVN plugins) and sometimes introduce inconsistency in behavior (for example, synchronization look and feel is different for different team providers) is THE real Eclipse problem. This is a back side of the popularity and flexibility. Other things are minor in comparison to this one. I think that many such problems will be solved by introduction of Eclipse Market and move of some most popular plugins (in particular – Git and very good Maven plugin) to Eclipse incubation.

  19. One of the main advantages of Eclipse is that it was designed to be so much more than a Java IDE. Develop a JVM written in C/C++ and Java from within the same IDE? With Eclipse, No problem…

  20. coooool post man…..
    I am also a big fan of intelIJ IDEA…

  21. @Marcus, For C/C++ yeah, Eclipse has the advantage but no with other languages. What’s cool in terms of jetbrains in this are is the fact that they’re working on an IDE for Objective-C (source: http://www.infoq.com/articles/jetbrains-developer-tools ), similar to what they have done for Python (PyCharm) and Ruby (RubyMine), and that sounds pretty cool. It’s true though that Intellij itself can be plugged in with Python and Ruby plugins too.

  22. I was quite a big Eclipse fan myself, until I got to try out IntelliJ IDEA 9.0 CE…

    Why did I try it out? I was not happy with Eclipse’s performance and clutter, although it did everything I needed. After I’ve tried it (IntelliJ) for a while, figuring out how to set up projects and modules, there was no looking back.

    Fast, intuitive, clean, smart. That’s IntelliJ. Eclipse became the Jack-of-all-trades-master-of-none-IDE. Eclipse is a brilliant platform and with all the backing from big names such as IBM and Google, it will remain a good option.
    IntelliJ on the other hand is committing to the Getting Things Done way of doing things, keeping the important things at your fingertips and the unnecessary hidden, though still within reach.

    Re. the remark on a “lack of knowledge” wrt. Eclipse: Why does it take forever to master Eclipse, but using IntelliJ IDEA it’s just a little while to get on the same level and surpass the productivity you had before.

    I’m the only one at the office using IntelliJ, whilst the others seem to like masochistic ways… :P

  23. I’ve just found out something else. Shelving changes, apart from shelving the modifications also stores things like breakpoints! This is great if you’re in the middle of debugging something and you have to change to something else. When you get back your breakpoints are still there :) – Nice little touch!

  24. For all Intellij fans, here’s a good post on further improving Intellij 10′s performance on Mac: http://blog.amber.org/2010/12/intellij-idea-10-performance-on-mac-os-x/

  25. IntelliJ has its pro’s and con’s. At first I found it cumbersome. But with a little familiarisation its fantastic.

Trackbacks & Pingbacks

  1. Daily del.icio.us for December 28th through December 29th — Vinny Carpenter's blog

    [...] How IntelliJ IDEA Won Me Over | Galder’s Passionate Blog – It’s almost a year since I stopped using Eclipse as my main Java IDE and started using IntelliJ IDEA instead. Ever since I’ve been meaning to write this pos [...]

Leave a Reply

online slots UK | painters tape | Confidential and reputable payday loans online