Thursday 20 December 2012

Do you have IDEA?

Prelude

This post is intended as an introduction to why I love working with IntelliJ IDEA. If you haven't heard of it yet, it is an IDE, just like Eclipse or NetBeans, the only material difference being that it has an edition that costs money (but you can get a free open source license).

During this "review" I will be using the following notation to present my pros and cons:

This is something I like a lot.

This is something I don't like.

Pricing

After I have been using it for a few months I can say that it seems that being an essentially non-free product is a good thing: it feels that they are actively seeking to deliver better and more comfortable usage. It feels that their team doesn't just put in features, they try to do it in a way that is natural and easy-to-use and cool.

Disclaimer

These are just some of the experiences I noticed while coding. IDEA offers a lot more little "wow that was easy" or "wow that was clever" feelings, whenever it does something that feels just right in that situation. Those can only be experienced while watching someone working in IDEA, or better yet, trying it out for a few months.

I will probably post updates with new things in the future -- I will try to document all these moments when they occur.

The bits

Quicker navigation and pathfinding with test colouring.

Do you have tests? Probably, and if not you will probably have in the future. IDEA employs a very simple concept: all source that is marked "test source" should be coloured green in editor tabs. From IDEA 12 project viewer also has nice background highlighting.

Naturally this makes navigating between editor tabs quicker and navigating between source folders less confusing. I had a few mishaps dragging classes to the test sources instead of normal sources and vice versa. No more of that.

Collapse lambda-like anonymous classes

Did you ever frown over the boilerplate of one anonymous class to specify one line of real code? Well, Java 8 will solve that, but until that IDEA can collapse such code to omit the "useless" parts:

Again this is a readability feature which I think is brilliant.

Auto-completion tries to be useful and not wasteful.

When something auto-completes a function for me and puts the parentheses in, I usually end up clearing everything in the end because that is not what I wanted; I only wanted the name of the method, and I want to write the rest.

IDEA manages somehow to position the caret and parentheses and arguments in a way that did not feel like hinderance to me. This is all subjective, but all the completion felt much more close to what I (as a developer) would naturally do, instead of just following some rules of auto-completion.

Auto-completion without Ctrl+Space.

When I start typing IDEA automatically offers things, even modifiers like public or types as void. This makes writing new methods and new code much easier, while not using code generators (generate getter/setters... don't use them).

Selecting something in the pop-up list and pressing dot . will insert the selected thing, insert a dot at the end and position the caret after the dot. Again, much faster than "Enter, End, dot".

Commenting a line jumps one line down.

How many times did you comment out lines by Ctrl+/Ctrl+/ ↓ ?

IDEA goes to the next line when you comment. So you will only have to push / repeatedly while holding Ctrl. Trivial and useless? No. Saves you time when all you want is to quickly comment out lines. You don't have to select the lines, you just comment away. (But do be a good guy and not commit comments.)

No absolute paths, simple readable one module description XML.

IDEA has the notion of modules and projects. A project can have multiple modules, and modules are separate and independent entities. Configuring a module's dependencies and structure is very simple, and is possible with only one file:

Do note that the directory is not hardwired into the file.

Looks good.

To me. Utterly subjective.

Getting to the point of executing tests take a long time.

At least in my experience, executing the same batch of tests take a lot more time than in, say, Eclipse. I do not know the reason. There is a slight delay before the tests are started, I guess because they must be built, parsed and initialized.

It is not a big slow-down, but I am used to instantaneous execution, so this is a pretty bad thing for me.

No comments:

Post a Comment