Archive of articles classified as' "Uncategorized"

Back home

Why I love RubyMine

29/12/2012

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. Then 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 2 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), and ALT-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 a 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 or do/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 in terms of 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 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 out 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 to 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 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 complain 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.

4 Comments

Changed to WordPress

8/02/2009

I’ve changed my blogging system from Typo to WordPress. I found several problems with my Typo installation, specially regarding to performance. I was very interested in updating to the latest version of Typo, which addresses many problems (including its performance). Unfortunatelly, I didn’t manage to make it work in Site5, the hosting service that runs this blog. The last version of Typo runs on Rails 2.2. Site5 hasn’t updated to 2.2 yet. I updated my local gems of rails to version 2.2.2, but I didn’t manage to make it work (and it seems that I am not the only one having this problem).

I really love Typo and I don’t discard to use it again in the future. For now, I’m going to enjoy the benefits of using WordPress, the most widely used blogging System. I had some experience configuring a WordPress site, so I knew what to expect:

  • Extremely easy configuration
  • A huge amount of themes and plugins available

My first theme choice was Skittish (the theme I was using with Typo). The problem was that it wasn’t updated to the last version of WordPress and it needed minor fixes to work. I decided to browse the WordPress Theme Directory and this site which offers a selections of themes. Finally I found a very nice one: The Vostok theme. I was looking for something exactly like this:

  • Extremely clean and simple.
  • Maximum legibility with dark tones.

Their creators are experts in interaction design and usability. I think that a simple product like this blog theme is a proof of their philosophy and expertise. I just can thank them for sharing this wonderful theme under a GNU v2 license.

1 Comment

Posting from Textmate

31/05/2008

I’m writing this entry using Textmate. I been a lot of time waiting to use this fantastic editor. Finally, I’ve bought a 17 inches MacBook Pro. I’m really loving it!. So much time reading things about MacOS (and Textmate) and now, well, all my expectations are fulfilled.

Posting a blog entry with Textmate

Until now, I was using ubuntu in my laptop. JEdit was my every-day editor. I really consider it a great editor, totally customizable, extremely solid and with a huge amount of plugins available. I’ll keep using it in other computers (for example, in my work).

So why change? Well, like many people, I was amazed by the look of the Editor used by David Heinemeier in the first Rails screencast. Since then, all the reviews about Textmate I’ve read agree: it’s a superb product. I’ve only been using it for 3 days and I’m totally convinced it’s going to be my editor from now on. A very nice surprise is the excellent LaTeX bundle.

No Comments

Hello World!

29/04/2008

This is the first post in my very new personal page.

I created this site because I wanted to have a place to write about software development. I have interests in many areas, specially those related to MDD (Model Driven Development), software development methods and agile practices.

This site starts as a fresh Typo installation hosted on Site 5. I love Rails and Ruby and I intend to use this site as a place to experiment. We’ll see if the experiment lasts…

No Comments