This site is now just an archive over the rise and fall of Flash. The domain flashmagazine.com is available for sale
Login | Register
Review: IntelliJ IDEA 9

Review: IntelliJ IDEA 9

IntelliJ IDEA is a cross platform editor that really sweeps the competitors off the floor. Do you want a better workflow, snappy editor, refactoring that really works, solid code generation and fast intellisense? How about UML support? Flashmagazine takes a close look at the Java based editor that now offers Actionscript and Flex support.

What is it?  Java IDE with very solid Actionscript support
Platforms:  Windows, Mac & Linux
Manufacturer:  JetBrains
Website: http://www.jetbrains.com/idea/
Cost: free - €528

Are you tired of having to do the 'clean project/building workspace'-routine? How about an Actionscript editor that has refactoring and code hinting that doesn't break when your project reaches a certain (small) size? What about an editor that is capable of not looking trough every file in linked SVN repositories just because you saved a file? Then IntelliJ is for you.

I'm thoroughly impressed by IntelliJ IDEA, so much in fact that it's my new code editor replacing the Flash Builder/FDT combo I've been using up until now. Most often, Flashmagazine will be offered software licenses for free to do a review. With IntelliJ, I used the trial for 30 days and that was more than enough to convince me to buy it. That's right - I'm reviewing a software I bought and paid for that nobody asked me to review. That's rare.

Setting it up

Lets start with the basics. Downloading and installing is very smooth. The setup is simple but feature rich and the project setup requires minimal skills. As opposed to some other IDE's I've used, IDEA can use any SDK installed on your machine and it handles all the setup smoothly for you. Adding new Flex SDK's are also easy. You just download from adobe.com, unzip to a folder and browse to it using IDEA. That's it.

IDEA will always create a sample "Hello World" project for you that compiles with no changes. You can name this what you want and the only thing I've found annoying is that I can be a little too fast so I forget to check the "Actionscript project only" checkbox. If I forget this, I'll just delete the folder and make a new project. The entire setup and getting started has been totally smooth with a couple exceptions that I'll come back to later.

The program is organized as panels that you open or collapse to the borders of the program. Clicking any of the buttons around this border will open that panel. The panels can be collapsed, docked and undocked easily and it takes very little time to go from an overview like this:

image

to a zoomed in debug session like this:

image

To zoom the text size, just hold down CMD + scroll the mouse. 

Highlights

What I instantly loved was how much IDEA knows about your code. The code highlighting are simply brilliant. The IDE always knows if you have unused variables or imports. These are highlighted as grey and the second you use them, they change to the right color. Any non-existing methods are shown in red, so if you are writing a handler that you have not yet created you'll see this right away. To create the missing variable or method, just hold down the ALT-key and press Enter. This brings up a menu that will create the missing method with all required parameters. It's simply beautiful and while a few other editors have this, IDEA is just amazingly better at this.

As an example of how it's better - when you rename a variable, all instances of that variable will change - while you type it in. There's no dialogue, it just happens in your entire project as you type! As with other editors, you can just right click any class to open it at that very method. As with FDT, if you click a property that is Flash Player native, you'll see a stub class with all parameters, rather than that stupid dialogue that tells you it's a Flash Player internal class. Top that with the fact that the undo function even remembers you changes even if you close a file! There are simply so many neat features in this editor that I catch myself smiling every time I discover one of these features. 

image

Another thing is the speed. The IDE is snappy and if you're used to Eclipse based IDE's you'll love this. It's not as fast as FlashDevelop on a good PC but this is the fastest Java based IDE I've ever used. Being based on Java, it can also run on any platform be it Windows, OSX or Linux so you're more free to swap platform using this IDE.

Super code generation features

Intellisense and Code completion is excellent. When you import an API, IDEA will inspect it to build an index so you are not limited in any way. Hitting CTRL + Space will complete the current half-written statement (if possible). If not possible, a dropdown list of options are shown with the most likely ones at the top. CMD + O opens up a tree with all the methods valid for your class, based on inheritance and CTRL + N will open a menu for generating getters, setters and more.

image

Selecting any method from an inherited class will write a complete override method for you. You can also implement missing methods from interfaces using CMD + I. Interfaces have never been this easy to handle.

image

I also love that you can select any block of code, press a shortcut and quickly add conditionals such as if/else, try/catch, do/while, for and more around that block. This extends to many things so if you want an if around a line of code - once you've written the if-statement - IDEA will indent the line of code below and close the bracket for you. I have not tried this myself but adding new code templates is easy.

Free from workspaces

One thing that have always annoyed me with Flex/Flash Builder is that you are forced into organizing your files according to workspaces. Switching between these is time consuming and it really does not provide much extra to someone that already knows how to organize their files. Also - with the Adobe tools, you can only have one instance of the IDE running at once. With IntelliJ, you can have any number of instances running so you don't need to switch projects and workspace just to show a colleague another project or inspect something. You can put your project files where you want and clicking the .ipr project file will open the project in the IDE. As with Eclipse based IDEs, can't right click an .as file and edit it straight away but this is heaps better in terms of OS integration.

The windowing system is a bit odd, but I expect this having to do more with software patents than a will to implement. I've added a couple feature requests as I've tested and both bug reporting and requests are handled in a snappy and professional manner. I don't know anything about the size of JetBrains - the makers of the software - but they seem lean enough to implement required changes quickly.

Code formatting

As in FDT, the Code Formatting is very solid, but IDEA offers more options. Don t like the style of the code base you inherited, just convert it to your own style. Since IDEA also edits HTML, CSS, PHP, Javascript, SQL and Java files you have full options for these files as well and you can add more languages via extension.

image

Code inspection can be triggered and set to run as a background task while you're coding. This will produce a solid list of possible issues regarding assignments, code flow, possible bugs, missing statements and much more. The list even includes a spellchecker, so you can check if your code is readable to others and catch obvious spelling mistakes. I especially love that fact that if you forget to use camel-case, it will highlight this using a standard red dotted line beneath the word. It's all done discretely so spelling mistakes won't annoy you while you code or browse a codebase and you can configure if you want this to show more clearly.

Unique features

There are so many unique features in this IDE that I really don't know where to start. Let me start by saying they're all quite unintrusive. The IDE never annoys me and that's never been the case with other IDE's. If/Else statements can be quickly switched. If code can be optimized or the IDE knows how to do things better, you'll see a small lightbulb (an IDEA!) that you can click to view the suggestion. When you delete a class, you'll be offered to do a safe delete that checks you project for the use of it. Want to know what parts of your codebase are dependent on a class? Right click anywhere in the class to to select Dependencies (forward, backward or even cyclic references). By pressing Alt + F7 you can quickly find all usages of a class, method or variable. The Analyze menu also allows you to look for duplicated code to help you during refactoring and as mentioned, the Inspect function is invaluable. I should add that these tasks can all run in the background while you keep coding. Oh - and if you don't run it as a background task and it's visible for more than 2 seconds, it will show you tips and tricks so you can watch that rather than the progress bar. Not important, but a nice touch and IDEA is full of these.

 

image

 

Some features you find in the menus won't necessarily work for Actionscript and the reason is that IDEA was written as a Java editor so some features are not applicable for our line of work (such as analyzing dataflow). These could well be removed while working on an Actionscript project, but they're kind of good to see that they exist as well.

Another sweet feature is ftp/sftp support built into the IDE. How often don't you test something and have to switch back and forth between the IDE and the ftp software? This really takes the pain out of it and if you use Code Versioning you have all you need installed. CVS, Subversion, Git and Microsofts TFS works right out of the box. ClearCase, Perforce, StarTeam and Visual SourceSafe are available. No more installing Eclipse extensions of varying quality - this just works. If you work in a Java environment, you'll also appreciate the Ant and Maven integration that require no extra install.

Another lovely feature is the UML generation. Right click any class to build a full UML diagram of it. This is just perfect for checking out new APIs, though I would love to see a way to easily hide the native Flash Player classes. It works well enough to be really useful though.

Debugger and refactoring

IDEA has a simple, but very effective debugger. As in any other IDE it triggers when something goes wrong or you asked it to stop using a breakpoint. The Debugger is snappy as it does not inspect the entire file. It just stops the SWF and then inspects any objects as you browse them. The trace outputs go to the console as you expect but I'm missing having a proper Profiler. Hopefully this will be added in a future release.

image

Other IDE's have basic refactoring such as renaming classes and variables or moving a class in the package structure. As mentioned before, IDEA can do this (better) but it can also do more. You can inline variables, extract methods, copy files to a new file with class names and packages updated and you can even move methods up and down in the inheritance tree.

image

Negatives

As with any IDE, there is some getting used to. I didn't find it very hard to switch, though it takes a little time until the keyboard shortcuts are in the fingers. I downloaded and printed the Keymap until I felt that I didn't need it any more and I am surprised at the coding speed I now achieve. IDEA really helps in that regard and going back to any other IDE is a pain now. One thing that i found very odd is the lack of support for CTRL + W to close windows. IDEA uses CTRL + F4 and that took some time to get used to. I could of course have set it up in preferences, but I prefer to not use custom key mapping.

There's other UI things as well. By default, you can click and type anywhere on a line, so clicking beyond the end of a line will leave the caret exactly there. This can be convenient at times, but also confusing. I initially turned this off, but it's actually quite convenient when you want to add a comment somewhere after the end of a line. It's just different and I would expect it comes from command line tools that'll let you do this.

There are a few things that had me stumped while testing. One thing is that JetBrains are consistently using the name Flex over Actionscript? I kind of understand this from a Java developers perspective, but I find it a little odd as Flex is just a framework that runs on top of the Actionscript language. Another thing is that you can't re-organize the main tabs as in Eclipse or any modern browser. It's not all that important, but it's convenient at times. (see Scully's comment)

Another issue I got was one that many may stumble upon. Upon every export, I got a dialogue that said that the debugger was already in use. This was caused by me having a non-debug version of the standalone Flash Player installed as my system default. Easily fixed, but not obvious unless you know. Another annoyance is that if a file is already running, IDEA can't stop it automatically. I rarely need to test multiple SWFs at a time so can I please have a checkbox that says "Always disconnect from running the compiler process" so I don't have to tick "Terminate the process after disconnect"?

When creating a project, you first specify a Flash Player version to target. When you set up the HTML wrapper, this choice is not retained so you have to change the defaults. All of these should be easy to fix and I've logged some of them in the official bug-tracker. They're also not show-stoppers in any way.

It's a little different

IDEA projects are set up using the Project Structure dialogue. Here you'll find Modules - a concept that will be new to Flash devs since it is taken from Java. When you link in external APIs, it seems logical that you add them under the Libraries setting. If you do so, the intellisense will work, but compilation will fail. Next obvious step for me was to look under Modules -> Dependencies and add my library here (SWCs go here). That didn't work either and it turns out you have to do this using the Module setup. It took me way too long to figure out that the text that says "Add Content Root" is actually a button. Clicking this will let you add any APIs required at compilation time. After adding this, you click the root source folder of the linked API and click the Sources button. Not hard when you know how to do it, but in no way obvious.

image

If you run into trouble with Error #1014 and java.lang.IndexOutOfBoundsException's when using embedded assets, just set the additional compiler flag -static-link-runtime-shared-libraries under your Module Settings - > Modules -> Flex Compiler Settings.

Pricing and Open Source

IntelliJ Idea comes in two versions - the Community Edition and the Ultimate Edition. The Community Edition is Open Source and free, but lacks some of the more advanced features such as UML and application server support. It also only supports a limited number frameworks, version control systems and languages. Some of these can be added via free plugins but not all.

Commercial licenses start at €220 / $249 but you can get a site license for a little more than the double. There's also academic versions available (€88 / $99) and trainers/teachers can get a free license by applying for it. You can also download a 30 day trial to check out the full product.

JetBrains, the company behind IntelliJ Idea realize the fact that those involved in Open Source projects often lead the way for other developers. Anyone involved in Open Source projects, can apply to get an Open Source Project License for the Ultimate Edition.

Conclusion

As with all new tools, there is some getting used to and changing your main development tool can be really hard. IntelliJ Idea is no exception, but I have to say that it seldom feels more rewarding than this. As opposed to Eclipse based IDE's, this feels snappy and the tool does not get in your way while working. Help is available, but the only thing you really need to learn is the keyboard shortcuts. All the functions you want are available using the keyboard, reducing the need to use a mouse all the time.

IntelliJ Idea is also very extendable and the selection of plugins is solid with more than 600 registered plugins. There's plugins to improve the editor, build tools, obfuscation, working with databases and even less useful but fun stuff such as Tetris and Last.fm. More important, there's plugins for languages like Scala, Lua, C/C++, Python, Ruby and others.

I'm really impressed by the completeness of IntelliJ Idea and how much it "knows" about my code. It's really not anything that I'm missing here other than the profiler. It's not often I review software that I become so impressed with that I start using it for my daily work. Switching workflows is hard and this is especially true for programmers when it comes to their code editor. There's so many things that I like here - big and small - such as the feedback form that pops up after using the software a few days, asking you for feedback and if they can help you in any way.

 

About Jens C Brynildsen

Jens has been working with Flash since version 3 came out. Since then, he's been an active member of the Flash community. He's created more than a hundred Flash games (thus the name of his blog) but he also creates web/standalone applications, does workshops and other consulting. He loves playing with new technology and he is convinced that the moment you stop learning you die (creatively speaking). Jens is also the Editor of this website.

Next review:
Partigen 2.5

Previous review:
Review: Camtasia 1.1 for Mac OSX

Get new stories first

Click to follow us on Twitter!

 

Comments


Posted by Izitmee on 07/06 at 06:36 AM

Interesting article, though it would be nice to know how it compares to FlashDevelop (apart speed and platform compatibility).
Kind regards,
Daniele


Posted by igor on 07/06 at 10:09 AM

I already use FD for some years but I’m now testing Intellij on my Mac.  This is kind of logical because I have to run FD through Paralells which is far from ideal.  But apart from that, this is what I already have noticed:

- it’s scary to experiende how much Intellij knows about your code.  When you for instance move your swf-object to another folder, the html is immediately changed accordingly.  Other example, it scans your xml-structure when you open an xml-file and immediately start code completing tags.
- it has SVN and FTP build in right away.
- local history for file-changes build in, even before commited to SVN
- refactoring is impressive
- changes to code-completion for other languages when needed, even when you have a AS String which has html, it changes to html in the text-part.
- negative: the project-setup isn’t straight-forward. Since it is a Java-IDE it has a completely different terminology and boasts features unkown in the AS-world. I used the tutorial of Jess Freeman: http://insideria.com/2010/02/intellij-idea9-actionscript-3f.html
- negative: the editor has far too many features (from point of view of an AS developer).  I haven’t found out if you can change menus, but I’d get rid of at least 50% of the items.
- negative: not free, but really worth the money


Posted by Jens C Brynildsen on 07/13 at 03:42 PM

@Izitmee You want to know how it compares against FD in general or anything specific? I’m on a Mac these days and running FD through emulation is no option. If I was on a PC, I would probably use FD for it’s sheer speed.

A user group colleague of mine is using FD on a daily basis but he really likes IDEA a lot after trying it. I can’t link to his tweet on this since “Twitter is broken” (tm) as always, but from what he said, I think he may switch to IDEA soon.

J


Posted by Izitmee on 07/13 at 04:12 PM

Thanks for the additional info Jens :)
I was curious about a general comparison between FD and IDEA (especially now that FD v3.2 has introduced lots of new stuff, like an almost serious debugger and refactoring). I sometimes have to use Flex for some team jobs, and I find it a real pain compared to FD, but I’m always curious about new environments (especially if they come with UML support included - Saffron, where are you? :P).
I’m very fond of FD (and constantly support it), but I guess I’ll give IDEA a try and see how it behaves, especially now that you tell me that an FD daily user is - maybe - changing sides.
Kind regards :)
Daniele


Posted by Izitmee on 07/13 at 04:15 PM

P.S. @igor, thanks to you too for the additional data :)


Posted by Jens C Brynildsen on 07/14 at 09:00 AM

Here’s the link to Andreas Tweet: http://twitter.com/sunjammer/status/17564802276

Saffron? Yeah. Wouldn’t it be nice if it wasn’t all vaporware?

J


Posted by ain on 07/14 at 04:13 PM

Great and thorough review! Agreed on the fact that none of the Eclipse-based editors are snappy. Hoping that Helios (3.6) will bring a change here.

I’ve also been experimenting with another open source platform that relies on AXDT, see http://tekkie.flashbit.net/flash/axdt-open-source-cross-platform-alternative-for-flash-development
It’s in its early stages and currently being rewritten on top of Xtext (instead of IMP) and is quite promising. We’ll see how it does.


Posted by scully on 11/03 at 03:26 PM

You can re-order tabs. Type ‘tab’ into the settings search box and tick the ‘show all tabs in a single row’ box.


Posted by Jens C Brynildsen on 11/03 at 05:38 PM

@scully Thanks for posting that one! Several other nice options under that setting as well such as showing an asterisk for unsaved files.

Funny thing - I talked to the intelliJ ppl about this and they didn’t remember that this was possible :)


Posted by scully on 11/05 at 11:29 AM

@Jens C Brynildsen I’m just evaluating IntelliJ for using on my own (non day job - which is C#) projects. Looks like they’re now giving a fair bit away for free, but I wanted to know how good their Flex support really was, thus I found your article. I didn’t even know that the tabs couldn’t be re-ordered, which worried me until I found the solution via a bit of Googling where there was some reference to a plug-in (which I think was for 4 or 5 versions of IntelliJ ago). They should probably have this option turned on as default. Good article, btw.


Posted by philandrews on 05/30 at 04:49 AM

You prevent debugger from opening multiple SWFs with an Ant script which runs before the launch. http://fatlinesofcode.philipandrews.org/2011/05/29/ant-task-to-terminate-flash-player-debugger/


Posted by Jens C Brynildsen on 06/01 at 08:24 AM

@PhilAndrews Brilliant! I’ll check it out as soon as I get a chance!

Submit a comment

Only registered members can comment. Click here to login or here to register