The competition in this market is very strong with such well established players as JBuilder, Forte/J and VisualAge.

So why IDEA? Because it knows everything about your code. While its editor is rudimentary, IntelliJ claims they will have emacs emulation soon. But that doesn't matter because the tool does everything for you. It has a complete parse tree in memory so as you write your code, it immediately shows you errors by underlining them in red. That's just the start, then comes the fun part. Because it has a complete parse tree you can do:

1) Refactorings such as rename variables and methods. IDEA tracks down all the references, shows you what it found and with a single button does the work.

2) Very fast cross referencing allows you to find all the places that reference a class, method, attribute or variable. This is precise because it knows context information such as scope and method signatures. Quickly jump to the declaration for any class, method, attribute or variable.

3) Automatically create get/set methods and constructors for a class based on its knowledge of a class's attributes.

4) Code completion. Object browsing in a tree-like browser.

5) Automatically insert the right import statements into the code based on its knowledge of all class libraries.

The list goes on for a while but you can see the rest on the web site. The list above is what I find most useful.

In addition, the tool has a well thought-out IDE with side-menus which open panels from the left, bottom and right sides of the main window. Given that this IDE is in its infancy - Version 1.1 is still just early access - you can expect a lot more in the future. It has become my preferred IDE over Forte/J as soon as it was discovered.

More later...

SZ

Posted by beg on 05-15-2001 09:27 PM:

Refactorings in IDEA 1.1

As for refactorings, here is what's already there:

- Rename package/class/method/field/method parameter/local variable. These refactorings will rename the correspoding element and will also rename all usages of the element everywhere in the project. The two-step refactoring procedure will allow you to control which usages are to be finally modified and which are not. It also may search for usages in string constants and comments as well as in the code itself.

- Move package/class. Allows to move a package or a class to another package and will correct all references as in the previous refactoring.

- Introduce Variable. A very useful and frequently used refactoring. Select any expression in the editor and IDEA will make a declaration of the variable right before the statement and replace the expression with the newly created variable.
IDEA will analyze the expression itself and suggest you a few names for a new variable. The rules of name suggestion are mainly derived from Sun's Java style guidelines. And sure you can always enter your own variable name.

- Extract Method. Select any code fragment and IDEA will turn it into a method. The old block will be replaced with a call to the new method. As you execute the refactoring IDEA will determine the input and output parameters right from the code and will suggest the new method signature.

- Change signature. This is a refactoring combining a few different tasks that can be done with a method signature. The possible tasks are:
- Add parameter
- Remove parameter
- Reorder parameters
- Change return type
- Change name (does the same as Rename Method)
Together with changing the signature itself, IDEA will search for all usages of the method and will change all calls, implementations and overridings of the method to reflect the change. In case of an added parameter, a default value of a parameter should be supplied and it will be used for those calls.

There are a few more refactorings to come in the upcoming version such as Move Method and others.

Here are some new feature suggestions that have come to mind while actively using IDEA for development:

+insert package statements - allow IDEA to insert the package statement for a file based on the current directory and knowledge of the root of the package hierarchy for the project

+move method to superclass - move a method to a class's superclass

+save stack trace to file - while debugging, save the stack trace to a text file for later reference to see how a program reached a certain point during execution

+set intelligent bookmarks (method, class) - allow unlimitted bookmarks to be specified to allow a developer to quickly get back to a location in the source code. By allowing the bookmarks to be by method rather than line in a file, the bookmark will remain relevant when new code is added to a file, thus altering the line numbers

+better history list for forward and backward navigation - keep a full history (similar to linux bash) of all the files that were visited for easy navigation backwards and forwards during a session. Also allow keeping the history of navigation to methods from the structure toolbar if so desired along with file navigation.

+add new method in client code, underlined in red, jump to provider class and define the method with the same signature - this allows a developer to first think about what method she needs in a class from the client of the class and then have IDEA jump to the source for the class and add the method. Some UML tools allow a similar approach: when designing sequence diagrams the tool allows you to create a new message for a class and then define the method in the class.

+insert code for a pattern [GOF] into a package - allow IDEA to insert the classes needed for well known patterns from the GOF book. The classes could all be initially put into one package.

+show statistics for referenced code - allow the creation of utilization statistics to see how many times a method or attribute is referenced. This allows a developer to determine the complexity of a program. This feature could leverage the strong cross-referencing in IDEA

When the line number in the file of the bookmark changes because of other changes in the file, the bookmark automatically adjusts to the new location.

Very slick and very useful.

Some other very cool features:

You can highlight any expression, even one which includes method calls, and select Run:Evaluate Expression and it will show you the result. This is very useful for method calls which return results which are not assigned to a temporary variable.

The Structure panel now shows the list of methods for a class grouped by superclass to show which superclass methods are overidden.

Better yet, the left hand column of the editor window has a little up arrow next to methods which override methods in a superclass or implement methods in an interface. By hovering the mouse over this up arrow, a tool tip will appear to show which superclass or interface is involved and by clicking on the up arrow it will take you right there.

IntelliJ continues to demonstrate innovation and creativity as well as a good understanding of how to make object-oriented programmers productive.

Posted by SZ on 06-07-2001 07:33 PM:

automatic javadoc headers

A really cool feature would be the automatic insertion of a javadoc style header for a method.

This could be based on the signature of a method - method name, parameter names and types, and return type.

This feature would save a lot of typing. IDEA already knows all this information so the user could click on the method name and then ask IDEA to create the javadoc information automatically. After insertion, the user could add more details.

Posted by beg on 06-10-2001 11:44 AM:

Yep, it's a good thing and is already planned for one of the next versions.

The only glitch I found here is that when I tried to examine an exception stack trace, it caused the connection with the server to be terminated.

code insertion
If while you are coding you realize you need a try/catch block, highlight the code and select Code:Surround with..., and select try/catch.

This works so well that it takes care of all the indenting and automatically figures out which exceptions to catch, making a separate catch expression for each!

code formatting
The tool supports a powerful code formatting feature with a nice array of customization options. But what is cool about this feature is that you may apply formatting to all files in a directory subtree.

I did notice memory limitations when dealing with a large subtree. This is easily solved by performing the task on smaller subtrees.

brace matching
If you put the cursor on the closing curly brace for a large conditional block, IDEA will display at the top of the window the conditional expression that began the block. This makes it easy to match braces and to navigate within the code.

Posted by wellington on 07-09-2001 12:33 PM:

change signature

Started using the refactoring change signature and I am finding it very useful and powerful.

This refactoring allows you to add or delete parameters for a method and even change the order of parameters. When a new parameter is introduced, you pick a default such as true/false, null or a String constant. This allows IDEA to add the parameters to existing method calls without breaking anything. Of course, your method needs to be updated to handle the defaults.

Prior to performing the refactoring, IDEA shows you a list of the locations found in a window. You have the option of excluding any of these instances from the refactoring.

Another, related feature that I started using a lot is Show Parameter Info (Ctrl+P) which provides a synopsis of the parameter names and types for an existing method invocation. Use this when you are not sure which parameters are which and they have the same type, such as boolean.

Posted by SZ on 07-18-2001 06:20 PM:

find/remove dead code

In the midst of doing a bunch of refactoring, a new, useful refactoring for IDEA came to mind.

The ability to find dead code, as in methods or constructors which are not in use anywhere in a project.

IDEA could allow you to search for dead code by path and present with you the list of methods or constructors, allowing you to delete or keep those that you select.

For instance, I am in the process of removing a whole bunch of obsolete constructors and currently have to search one-by-one for usages to make sure that they are not in use. Then I have to manually delete the lines of code.

Posted by capecod on 07-24-2001 04:12 AM:

extract method

Just started using the refactoring Extract Method and it works! This feature worked more smoothly than I would have thought. To use the feature you highlight code within an existing method that should be separated into its own method and then just run the refactoring. The code is placed in its own method, which IDEA lets you name, and the original method has the code replaced by a method invocation. IDEA even figured out how to preserve the result by assigning it to a variable. Not bad for intelligence!

optimize imports
Another new feature I'm using now is Optimize Imports. This feature is accessible from the Code -> Layout Code menu. My main intent is to cleanup imports that are no longer needed. Since IDEA will specify just the imports you need (down to the class level), I assume that this feature also helps at load time, so that the JVM has less searching to do for external classes.

finding imports
Another slick feature of IDEA is its ability to automatically find and then suggest the import statement required when a class/method is used for the first time. As an example, say you want to create a JButton within your class; when you enter the statement 'new JButton...', IDEA will suggest that you include an import statement for JButton. All you do is enter 'Alt-Enter' and IDEA will insert the import statement at the top of the file and allow you to continue editing.

Posted by SZ on 08-01-2001 03:55 AM:

Ant Integration
Who says open source isn't cool??
And who says that closed source can't leverage open source software??

IDEA version 2.0 is out and it has a very nifty integration with Ant. For the unitiated, Ant is a replacement for the make utility found in Unix systems. Since Ant is written in Java and uses XML as its file format, it is a truly portable piece of software.

IDEA has created a stunning integration with Ant by creating a graphical, tree representation of the build tasks in an Ant file. You may click on a task and either run it or view it in an XML viewer. After Ant has run, IDEA shows you the results in a similar, graphical tree representation of the results.

If you haven't worked with Ant yet, here's your chance!

Posted by capecod on 08-17-2001 12:56 AM:

CVS integration

Tried the CVS integration finally.

Like the Ant integration, CVS works very smoothly. This shows how powerful the open-source paradigm can be: sophisticated, reliable make and source-code control systems are key components of any development environment and IDEA shows how well they can be integrated. Integration reduces the total number of different applications a developer needs to install and run.

The CVS integration is similar to WinCVS with a button which allows only modified files to be visible and another to filter out non-CVS files. When you right click on a file you get a typical menu allowing update, commit, diff, status, log, etc.

One limitation we found compared to WinCVS is the lack of macros, such as find all modified files.

One feature lacking polish is the version number and date/time of the files. They follow right after the file name instead of being in separate columns.

A feature which excels over WinCVS is the diff command: it brings up a new window with side by side comparisons of the two versions with highlighting for the differences.

I expect that subsequent versions will improve over this initial version, making the tool truly integrated and powerful.

Posted by SZ on 08-22-2001 03:42 AM:

live templates

Live templates are cool.

It took a little bit of investigation (inquiry to intellij) to figure out how templates work but it was worth it.

If you type in CTL-J you get a list of the available live templates. By selecting one you get automatic insertion of the code for the template. Then you just fill in the missing pieces. Some of the templates:

The cool part is that they have made abbreviations for the templates. The way it works: you type the abbreviation and then the TAB key for expansion of the abbreviation into the code for the template. You can find out the abbreviations by using CTL-J.

Other, related cool features are the Code->Implement Methods menu option which allows you to pick from the list of unimplemented methods for an interface and the Code->Override Methods menu option which allows you to override ancestor class methods. In both cases, IDEA fills in the template for the method being implemented/overriden.

These features are not just cool. They really help improve productivity and the pleasure of programming.

Posted by capecod on 01-31-2002 03:13 AM:

CTRL-W, select unit

The advantage that fully syntax-aware program editors have over other editors becomes very clear when using IDEA.

A new feature that I just discovered is the CTRL-W keyboard command. This command selects and highlights a program unit, whose size depends on the number of times CTRL-W is entered consecutively. Starting from my cursor location, here is the order I encountered: variable, expression, statement, statement block, method, class.

The utility of this feature is high. If you need to move code around using cut and paste, this feature will enable you to rapidly select the program unit you want, without fiddling around with a mouse to select it. You have to try it out to see how truly powerful this command is.