To content | To menu | To search

Feedback of my use of IntelliJ IDEA

When I began to work for Silverpeas in 2012, I used to use Eclipse as IDE for my everyday work. Some of the staff were working with others IDEs, among them NetBeans and IntelliJ IDEA. Because the life-cycle of the Silverpeas build is based upon Maven, we can choose any IDE that fits our habits and our needs. But one day, in the case of the development of a transverse functionality implying important impacts on the code base, I needed an IDE that provides me strong debugging and refactoring capabilities while maintaining a good pace of productivity. That's why I ended up using IntelliJ IDEA after being arched by some other IDEs. Silverpeas being an Open-Source project covered by the AGPLv3 Free Software license, our team has a free license for the Ultimate Edition of IntelliJ IDEA; without it, I would have probably never given a try to this IDE. Now, after using IntelliJ IDEA for 2 years, with this post, I can give you my own feedback divided into several sections, each of them covering a part of IntelliJ I like.

Installation

Like any other IDEs, the installation and the update of IntelliJ IDEA is easy and fast. When a new version of IntelliJ is available, a notification box appears and, in the case of a minor version, the upgrade is just performed by clicking a button. For a major version, we have to download and to install it; during the installation, the previous version is detected and the settings can be applied to the new installation. Nevertheless, some parameters can only be set in the idea.properties. and then they have to be reported by hand in the new installation.

Project management

When we have used other IDEs for some time, the project management in IntelliJ IDEA can be a little confusing. Indeed, in this IDE, each project has its own window; it is not then possible to open several projects into a single window. In fact, to better understand this strange behavior, we first have to change the vocabulary: in place of project we can substitute it with the term workspace as used in Eclipse, and as a project in IDEA is made up of one or more modules, we can think of them as being simply projects like they are handled in others IDEs. Once these specificities understood, we can just create an empty project and import into it all the modules we want to work on.

Silverpeas is made up of more than 50 projects, each of them based upon Maven, and using different technologies, frameworks or languages (EJB, JPA, Spring, Javascript, Groovy, Javascript, ...). To open some of them as a module in IntelliJ, we just have to select the pom.xml of the project and the IDE will import it as well as its eventual sub-projects. Once imported, the IDE is able to detect the technologies, the frameworks and the languages that are used in the module and then, for each of them, it activates a facet. A facet is a component in IntelliJ that represents a given framework, technology or language and through which IntelliJ provides to the developer some features to facilitate its use. The easy and the speed with which IntelliJ imports the projects and detects the technologies amazed me.

Another thing that blew me away was its code introspection and navigation features in all of the imported modules, whatever their count, and without suffering any performance breakage. Imagine, you can get a detailed list of all the calls of a given method, you can find a class just by a part of its name, or you can look for all the occurrences of a string, all in some seconds and with a project containing more than 50 modules.

The technologies taken in charge

IntelliJ IDEA takes in charge by default a lot of existing technologies, frameworks, and languages. All of the technologies used in Silverpeas are supported by IntelliJ:

   Maven
   Git (final project repositories on Github, https://github.com/Silverpeas)
   Java
       JEE & CDI
       JPA
       Spring Framework
       JSP
  Groovy
   ​HTML
       CSS
       Javascript
   ​JBoss Server
   Database
       Oracle
       SQLServer
       PostgreSQL
       H2

So, the navigation between the different source files of the projects is very fluid and efficient. For example, from a web.xml file in which is defined a servlet, by a simple Ctrl+mouse left click we can access the code of the servlet or from the code of a Spring service, we can access its declaration in a Spring context file.

Personally, since I've been using IntelliJ, I added only one plugin: RemoteSynchronizer. It synchronizes automatically some files on a running server with those of the opened project (JSP, HTML, Javascript, ...).

The GUI

The interface of IntelliJ IDEA is skinnable by applying different themes. For example, below is the default theme with the Silverpeas style for the code editor:

interface_default.png

Some of my colleagues prefer the Darcula theme as you can see below:

interface_darcula.png

Thanks to its theme support, we can adapt the skin of the IDE to our envies as well as to our eyes.

Besides that, the interface is well designed with many tools always within reach of a mouse click. There is a lot of popups for the search/replacement, the debugging, Maven, and so on and that can can be shown up or reduced either by a click of a button in the toolbar or by a shortcut. This is actually very efficient and intuitive. The IDE is in fact built upon the intensive use of shortcuts: all can be performed by a shortcut, all of the window's frames are also accessible by a shortcut. IntelliJ iDEA is an IDE built specially for the developer; it can do all stuffs without leaving its keyboard for the mouse.

There is a multitude of well practical tools, like for example:

  • the copy/paste buffer: a simply Shift+Ctrl+V opens a popup with by default the 5 last copies; we can then just select the copy you want to paste.
  • Ctrl+Shift+U either upper-cases or lower-cases the whole word.
  • Ctrl+J gathers several lines into a single one by taking into account the language.
  • ...

Of course, this post alone cannot explain all the aspects of the GUI. A book will be required for that and mainly to describe all the useful features to leverage in the code writing.

Setting

The setting of IntelliJ is both complete and easily accessible. It is easy to find an option, notably through the search field. Since the version 14, the look and the way the setting is categorized were even improved.

Below, the screenshot illustrates the power of the search by keyword: all the settings corresponding to the word Encoding are highlighted:

parameter_dialog_search_encoding.png

Like some others IDEs, it is possible to export our setting in order to be able to restore it or to share it among the staff. With this feature, we can define a setting template for our projects, and then

share it to all the members of the team.

Debugger

In my advice, the debugging is a strongest point of IntelliJ, mainly in the development of Web applications. The possibilities are pretty much endless; for example, we can:

  • define a breakpoint to stop either all the running threads or the current thread in a remote server,
  • define a breakpoint to log information about the execution context,
  • define a breakpoint that will be enabled only if other breakpoints will be reached by the execution,
  • and so on.

Like any other IDEs, a breakpoint is set by clicking on the left margin of the code editor at the targeted code line. By right-clicking on it, we can then access its properties as it is showed below:

debugger_breakpoint_widget.png

One click on the link More opens a dialog box from which the breakpoint can be parameterized more finely:

debugger_breakpoint_dialog.png

The screenshot above illustrates the different possibilities in stopping the execution: the current thread (id est the current HTTP request for a Web application) or all the running threads. Thanks to this feature, in event constituting a force majeure, we can debug an application in operation by specifying to stop only the current thread and then to let the other users access the server. (In development, it is more judicious to stop all the threads in order to avoid any interferences to the introspected object.) Another interesting property is to define a breakpoint as a logger: uncheck the checkbox Suspend to check either Log message to console or Log evaluated expression. This is very practical when we just wish to ensure the execution flow without having to stop it.

In the case the application server is directly started from IntelliJ, in our case JBoss, we have the capability to debug a JSP: respect. The screenshot below illustrates this point by showing a stop of the execution flow within a tag file which was invoked from a JSP.

debugger_jboss_started_from_intellij.png

With the IntelliJ's debugger, we can hot fix the code and the modifications are automatically reported to the application without having to restart it, as it is illustrated below:

debugger_compile__asking_update.png debugger_compile_updated.png When the execution flow is stopped at a breakpoint, the variables, a block of code or any things can be introspected either by the toolbar or by shortcuts that prove to be both very clever and efficient. The screenshots below are a showcase of this feature:

  1. The execution flow is stopped at a breakpoint

    debugger_code_inspection_breakpoint.png
     
  2. Left-click+Alt on the line 83 to introspect the prepareStatement method

    debugger_code_inspection_widget.png
     
  3. Alt+F8 to evaluate the expression

    debugger_code_inspection_evaluate_expr.png
     
  4. A click on Code Fragment Mode to swap on the evaluation of the entire block of code

    debugger_code_inspection_evaluate_bloc_expr.png
     

Git

The support of Git in IntelliJ IDEA is impressive. In fact, it is so well integrated with the IDE we can think of it like being a natural part of IntelliJ. For example, in the source code editor, the tools dedicated to the VCS are unobtrusive but are well present. To illustrate my points, here is an example:

  1. This is an example of code

    vcs_git_editor_before_change.png
     
  2. $slider is now renaming to $sliderContainer for our example

    vcs_git_editor_renaming.png
     
  3. the code that was modified but not yet committed into the VCS is identified by the blue highlighting in the left-margin. By clicking on it, the code before change is displayed

    vcs_git_editor_descriptor.png
     
  4. with the toolbar we can navigate among the modified block of code, to come back to the previous state for the selected lines of code, and to have a diff between two states of the code (before and after the change)

    vcs_git_editor_diff.png
     

Now, some functionalities I use regularly:

  • browsing the history of modifications of a code source, and then comparing several code states in order to glance through the differences

    vcs_git_source_history.png
     
  • comparing a code in the current branch with the same code from another branch (so convenient)

    vcs_git_compare_with_branch.png
    vcs_git_compare_with_branch_select.png
     
  • have a look to all the files in a given commit and see the modifications for each of them

    vcs_git_source_history_commit_show_all_modified_files.png
    vcs_git_source_history_commit_show_all_modified_files_widget.png

Refactoring

Because the software is enriched with new functionalities, because the technologies and the way we write code evolve over the time, the refactoring is an usual task in the software life-cycle to improve the existing code base, and in particular to rename, to move or to replace code. For doing so, IntelliJ IDEA provides a set of high quality tools. For example, when renaming a method, the refactoring doesn't stop at just to rename all the occurrences of the invocation of this method in all source files but it also processes all the annexes files like the Spring context file or the XML Web descriptor (web.xml). Even the comments are also touched by the refactoring!

Personally, I used and abused of the following tools:

  • the moving/renaming of packages and classes

    refactoring_package_renaming.png
    refactoting_class_move.png
     
  • the renaming of classes' methods and attributes

    refactoring_method_renaming.png
     
  • the adding or the removing of the method's parameters

    refactoring_method_signature.png
     

Thanks to the search engine of IntelliJ, some refactoring can be applied by a simple search and replace in the whole project (and by using a regular expression to match complex occurrences of a text to replace).

refactoring_by_search_replace.png

refactoring_by_search_replace_result.png
 

Areas for improvement

In my own advice, there are two things to improve in IntelliJ IDEA.

First, it would be nice the cache management in IntelliJ IDEA was more error prone. In this IDE, any modifications are automatically saved and any modifications coming from another tool are instantly synchronized in the IDE. But when the PC is overloaded (some times all of the 16GB of my machine are used) and there is a low-level system error (disk I/O errors for example) Windows can crash whereas IntelliJ is writing into its cache on the disk and in such a case, it can happen to lose the whole content of one source file. Over two years of using IntelliJ IDEA, this situation has happened three or four times.

Second, it would be great IntelliJ IDEA was more performant with Java 8 than Java 6 ;-) Indeed, in my case, it is frequent to observe some freeze of the focus (less than one second) when running with Java 8 whereas no such behavior has appeared when running with Java 6.

Finally

Of course, I'm far to cover all the features provided by IntelliJ IDEA.

The quality of the features in IntelliJ is such that after only some times my productivity was deeply improved! Even if you cannot buy a license for the Ultimate Edition, albeit its lack of some interesting functionalities and technologies support, the Community Edition will give you a snapshot of its possibility.