Why I love RubyMine
I love RubyMine. I have been using it for one year and a half as my main Rails/Javascript editor.
Before RubyMine I used TextMate. I never felt completely satisfied with it, but I liked its minimalistic approach, the rich suite of available plugins and how it looked and felt in general. At some point, I decided to learn Vim motivated by the good press it had among Rails developers. I didn’t get engaged at all.
I tried RubyMine and felt that I have finally found something that matched my taste and needs.
Things I like about RubyMine
Refactorings
There are two things I keep doing when I code:
- Renaming things
- Extracting blocks of code as new methods or variables
When I code, I am continuously renaming stuff and extracting methods and variables until the code looks clean to me. And I feel much more productive when I can have these refactorings performed automatically. RubyMine offers excellent support for them in both Ruby and Javascript.
Everything is navigable
RubyMine lets you navigate to any symbol by pressing CMD-B
(or CMD
click with the mouse). This includes Ruby gems in your Gemfile or JavaScript functions included in any file of your project.
I use this feature all the time. I missed it badly when using TextMate, and never felt totally comfortable using it in Vim via CTAGS support.
Keyboard friendly
RubyMine offers excellent keyboard support:
-
Most commands have predefined shortcuts and they appear in the menus so learning them is easy.
-
It has a nice editor with a search box for defining shortcuts for whatever action the IDE offers.
-
The whole environment is designed to be used with the keyboard. For example, when using modal dialogs,
CTRL-ENTER
will perform the default action and close the dialog (such as commit in Git). AndALT-SHIFT-ENTER
will open the alternative options so you can choose other option and close the dialog when selected (such as commit and push in Git).
Selection in scope
When you press CTRL-W
in RubyMine, you get the word on the cursor selected (as in TextMate). Press it again, and the selection will expand to include that word’s scope, such as the enclosing string or the method invocation it is part of. Consecutive keystrokes will expand the selection intelligently (enclosing block, method, class, etc.) I use this feature all the time.
Standard, discoverable environment
I appreciate having standard menus with actions and toolbars, having shortcuts displayed in menus and tooltips, having tabs, browsable trees and sheets of properties, having contextual menus properly displayed when I right click on something, and so on.
It is true that once you master the environment, you rarely move your hands out of the keyboard. But I think a nice environment benefits everyone: both power users and newcomers.
Search
RubyMine offers many search options, and these are beautifully executed. Coming from TextMate, this was another major relief for me:
-
Search in the current file is incremental and highlights matches as you type the search expression, even when you use regular expressions.
-
Global search lets you easily filter by file patterns and folders. It also lets you move through the matches using your keyboard (
CMD-ALT-UP/DOWN
), invalidating the results in real time if you modify the code.
Split views
Sometimes I like to have both the code and its test displayed in parallel. Splitting views is a feature TextMate users have been demanding for a long time (I think it was finally included in TextMate 2).
RubyMine lets you split the current editor in independent views and keep a set of tabs opened in each view.
Consistency out of the box
This feature is probably the most difficult to describe but is also one of the most appealing to me. In RubyMine things work in a consistent way. For example:
-
If you have a list of search matches, you can browse them by pressing
CMD-ALT+UP/DOWN
. If you have a list of failing tests, you can browse them the same way. -
If you place the cursor inside a hash entry and press
ALT-ENTER
you are offered the possibility of converting between=>
and:
notations. Do the same inside a block, and you can convert automatically between the braces ordo/end
syntax. Do it inside a string to convert it to a symbol. -
Errors highlighting, code formatting, refactorings’ they all work the same way whether you are editing Ruby, JavaScript, a CSS or Cucumber. I remember in my TextMate days not being able to pretty format Ruby, while I could do it with JavaScript. To have errors highlighting in JavaScript or CSS, but not in Ruby.
I appreciate the possibility of configuring and extending your editor but I like things working out of the box. And I think that RubyMine is exactly that: an extensible environment that works out of the box. RubyMine itself is a set of plugins running on a JetBrains runtime. And all of these plugins present a high level of quality regarding usability and IDE integration.
Integrated tools
My initial approach with RubyMine was using it as an editor only, using the Terminal for the rest of work (rails server, git, tests, rake tasks’) Eventually I started to use RubyMine built-in tools more and more, and found some of them very useful:
- Running your server or rake tasks within RubyMine let you click on exceptions traces and browse to the corresponding line in the source.
- RubyMine built-in test runner lets you browse failing tests, listen for changes to re-run tests automatically and filter the output for each test individually.
- Git support is excellent and it lets you commit, pull and merge changes without leaving RubyMine and without moving your hands from the keyboard.
When I am coding, I keep my RubyMine minimal. I only have the editor visible, without toolbars or other windows. But I use many of the built-in tools when I need them, and I have ended up liking them a lot.
Many other nice things to have
There are many other nice features of RubyMine I use everyday:
- Clipboard history
- Automatic completion
- Live templates (a.k.a snippets)
- Underline syntax errors in real time in both Javascript and Ruby
- Possibility of configuring automatic spell checking for comments but not for code
- Search for usages and references
- Excellent cucumber support, including generating steps from missing invocations or navigate to steps from their usages in features
- See the list of last opened files (
CMD-E
) - Navigate editing history back and forward (
CMD-ALT-RIGHT/LEFT
)
Major flaw of plain editors
Beyond the ‘work out of the box’ factor, I find another source of pain with plain editors: as long as they don’t manage a proper model of the edited code, the kind of assistance they can provide will fall short of my expectations.
I think most of the pain I felt when using TextMate, Vim or SublimeText 2 (my current plain Editor) came from this problem. You can use plugins and external tools to circumvent this limitation (such as CTAGS), but the experience is just not the same.
If the editor doesn’t know that the word under your cursor is a local variable defined as a parameter of a method, it won’t be able to rename it automatically, browse to its definition or include it as a parameter in a new method if you extract the block of code where it appears. I value syntactical tricks and powerful combos, but for my editing happiness, I need to get this basic stuff right first.
Conclusion
I don’t think there is such a thing such as the best editor for everyone. RubyMine is the best Ruby/Javascript editor for me, and I wanted to expose my reasons since I feel that this IDE doesn’t receive as many praises as it should.
I don’t think RubyMine is perfect neither. My major complaint is not having much better editor themes. RubyMine’s built-in themes or community themes don’t feel as good and polished as in TextMate or SublimeText. And of course, RubyMine is heavy in both terms of CPU and memory consumption. They have improved performance a lot in recent releases, but it will always feel heavier than any simple editor.