Musings from a Southern software developer

Tag: rubymine

After weeks of unpacking, building out shelves, replacing lighting fixtures, unpacking some more, organizing, selling our possessions, getting creative with storing what possessions we didn’t sell, and living off restaurant food, life is finally getting back to normal for me, the wife, and all the critters. Moving day came and went as smoothly as I could hope. Thanks to the blunder of the Warren property, we were overly prepared and living out of boxes for a week prior to the move. In eight hours time we went from being citizens of Braintree, Massachusetts to Barrington, Rhode Island. I was just getting the hang of spelling ‘Massachusetts’ too.

The new property is close to the bay, in a scenic suburb with lots of folks walking, biking, and taking the dogs out. While our street ends at the water’s edge, we did sacrifice quite a bit of space in the move. We have been power sellers on Craigslist, getting some liquidity for things we didn’t have room for in the new place.

Also on Craigslist, I picked up a 2008 Lemond Reno in gently used condition for a great bargin at $225. With a quick tune up, and a bike helmet I decided to bike into work on Friday. I haven’t been on a bike probably since I was in middle school sporting the Huffy around the cul-de-sac. I couldn’t believe how much fun it was to ride! I always found it obnoxious when bike people would talk bikes, but its different once the bike bug hits. All I have wanted to do since Friday is have my body heal enough so I can get back on the bike and ride into work again. We strategically picked this location because of its proximity to the bike path, and this will become my commute to work, as well as a fantastic workout. Its quite a scenic view on my way in, as the bike path follows the bay through Barrington, and down into Warren. Perhaps I can convince the wife to pick up a bike herself and we can venture down to Newport once we get conditioned.

The new job is going very well. I read some materials on Job Characteristic Modeling, and I felt it did a great job at explaining why comparable work at my new employer has been drastically different for me than previous work. I struggled with task variety, identity, significance, and autonomy, which was a recipe for unsatisfaction. Government contracts are hard, and I have a new respect for the people that can do it. Mojo Tech is reminiscent of my time at Clayton State where I was given large problems to work through (some running for weeks at a time) and a full spectrum of disciplines needed to solve them. I guess the moral of the story is experiment with different company styles until you find one that pairs well with the way you work.

In other exciting news, I will be doing a presentation on the Rubymine IDE this Wednesday at the Rhode Island Ruby Users Group. Look forward to meeting the other Ruby developers here in the state of Rhode Island.

Pictures of the house are coming soon, as we prepare the last of the decorations. We are having a house party this Saturday, and any co-workers, past and present are invited. Come meet, mingle, and check out our new pad!

The Boss decided to purchase a license to RubyMine for me to use, and the rest of the office to evaluate. I wanted to share my experiences, since there doesn’t seem to be a lot of real-world experience on developing Ruby on Rails in a corporate setting using RubyMine. Also, some of my new (and past) coworkers might be curiously looking over their screens with TextMate to see what else is out there.

First, a bit about the Ruby on Rails culture. It is a very Mac OS X oriented, and the preferred editor of choice is TextMate. I really try and stay away from tools that only run on one operating system, and TextMate falls into that category. Ruby is a very terse, dynamic and simple language. Rails developers will tell you that you don’t need an IDE to do Rails work. While this is true, I find not using anything more than a text editor is like using a screwdriver instead of a power tool. If you are a good developer, and you understand Ruby a good editor will only make you more productive. RubyMine isn’t meant to be relied on like IDEs are for other strongly typed languages including C# and Java. It makes a best effort to provide its features without getting in your way when it fails.

RubyMine offers full support on Windows, Mac and Linux. RubyMine also strives very hard to make the Windows version as strong as the *nix versions. It does this by including an IRB console, and commands to run many rake tasks, and Rails generators. While these tools are a very good solution on Windows, people with the ability to run a native terminal will probably find the offerings lacking in comparison. This review will skip these Windows-audience features, since I don’t feel it represents the majority.

Auto-Completion

RubyMine does a very good job at trying to autocomplete its code. It will look inside Class definitions, and can find methods, attributes, and associations. If you are using gems that extend classes, such as ActiveRecord, RubyMine will do a fairly robust job at reading these methods from the gem files once they are attached to the project. “Attached” just means that RubyMine is inspecting these gems. It was not able to locate gems provided via Bundler, but this is supposed to be coming. Also, the auto-complete can be slow at times and freeze the editor from further input.

Inline Documentation

When you place the caret over a method, or class, RubyMine will fetch the documentation for that method and show it in the editor. This is doesn’t always locate the documentation however, in cases where the method is defined in a gem that is unattached.

Command+Click Following

You can click class names, and method names to jump straight to the definition. Also useful is clicking on associations, and named scopes. You can also jump to route definitions, and partials.

Cucumber Integration

There is auto-complete provided for your Cucumber tests, however also nice is the Command + mouse over action of displaying the definition of a scenario step. These can be Command + clicked to follow to where the step is defined. Also, if your step does not match a definition, you will be notified in the editor.

Safe Refactoring

Refactoring in this sense is renaming a variable, or a filename. The nice part about RubyMine is the ability to optionally search your project for usages of the current variable, or filename and update those references, or just notify you about them.

Spelling

Not a big selling point, however many editors don’t offer strong spelling support. It checks your comments, and your variable names, but stays out of the way of your code.

Find By Filename / Class

You can pull up a dialog that will allow you to type a filename and it will return all matches regardless of directory level. Filenames can be regular expressions, and can include paths, and even line numbers. RubyMine will find them, and in the case of the line number, it will open the file and jump to that location. Searching by a class name is very similar.

Copy Buffer

Only having a clipboard with one item in it can be frustrating at times. Using the copy buffer feature, I can copy multiple sections of a file, then paste them individually later.

Code Formatting

RubyMine allows for manual formatting, or formatting on paste. You can also auto-format a complete document with a keystroke, based on your auto-format settings. It even works on HTML/ERB, HAML, Javascript, and CSS.

RubyMine isn’t a perfect tool however, and there are things about it that are less than ideal. Specifically, the footprint of RubyMine can be quite large. This seems to be a sin it shares with many of its Java IDE brothers. After watching it creep (unnecessarily) up to 400+ MB, I decided to do something about it. The solution turned out to be very simple. On OS X, look for the file “Info.plist” in the /Applications/RubyMine 2.0.2.app/Contents/ directory. On Linux, change the file in the rubymine/bin/rubymine.vmoptions file. Change the value for Xmx to be 128m. This is the memory cap in which RubyMine will run. Runs like a charm now, and for days too.

Other annoyances include the default editor settings. Changing to soft tabs was more confusing than it should have been. Allowing “virtual space” after then of a line leads to a lot of accidental whitespace. The right gutter line isn’t helpful for Rails development. The font face was terrible. I had to customize the default theme to make it use the Apple default font. And finally, I don’t like the “Project” oriented state. I would rather open from within a directory in the terminal and work from there. I also don’t care for it generating a work folder within my Rails project – its just one more thing I have to pay attention to when using version control.

All in all, this is certainty one of the best editors I have seen yet for Ruby and Rails work, while I am sure I haven’t even scratched the surface of what this editor is capable of doing. It beats Netbeans 6.x, and RadRails. It will be interesting to see how Aptana Studio 3 turns out as the Aptana folks seem to really be putting some love into it. These editors felt like Ruby support was tacked onto what was intended to be a Java editor. The other end of the editor spectrum are hundreds of weak text-editors. I wanted something in-between. RubyMine has a clear focus, and all of its options center around Ruby and Rails work. So, if you are using TextMate as your first, and only Ruby on Rails editor, give yourself some perspective try out RubyMine’s free trial.

We moved into our new office this week. It is really nice inside – very professional. I got to construct a cabinet from IKEA and I thought my head was going to explode. There were points in the instruction booklet where instead of describing something, there would be an arrow and the noise some action would make like “snap!”. I have never seen modular furniture that was so – modular. We are finally setup at the new place, and the overhead lighting is making everyone hate the stupid high-gloss iMac screens. Someone made the comment that it was “like being stabbed repeatedly in the eyes”, and another “could count the hairs on his face”. Now that we have more space, I will be getting a second monitor which I know will be much less frustrating. Along with our move is the mandatory male interior decorator that is stylishly unshaven, wearing a sweater under a brown corduroy jacket, and designer jeans. He was walking around the room talking about how “powerful” the color scheme felt. At least we got some new chairs out of it.

I finally got to the Registry of Motor Vehicles this week after dropping Kristin off at the airport to go back to Atlanta. Of course her being gone threw me out of my barely comfortable routine. The RMV made me surrender my Georgia license without giving me a Massachusetts license. Go figure. So with Kristin gone, the beer gone, and me without a license for the last week I think I went a little crazy. Now that Kristin is back, I asked her to do a beer run with my sad “help me” eyes. No license yet.

I figured I could go park the car at the train station this week, and ride in as usual. Kristin usually drops me off in front, so it shouldn’t have been that different. I got there around 9am the first day I tried it and the damn lot was full. I thought I was going to be clever and drive a block and park in another parking lot and walk back to the station. Apparently everyone tries that because the signs all said “T station parking illegal. Vehicle will be towed at owner’s expense”. The last thing I needed was a pending accident investigation, no license, and a towed car. I ended up just driving in the whole way which I have come to increasingly dislike. The rest of the week worked out better. I just got there earlier and the lot had spaces. The office is right across the street from the train station, so without the bus, it takes about 45 minutes to get to work from the house.

Work has been a mixed bag. Some days I really feel independent enough to feel like I am churning out good, usable code. Other days it is a lot of waiting, or some silly thing that I get hung up on for hours. We moved our project through my first “iteration”. Development on this project is done through “User stories”. A user story (either real, or fictitious) outlines what is a problem, and what needs to be changed to resolve it. A developer can read the user story, make the revisions to the code, and then write a “feature” that demonstrates that it is resolved. The cool thing about features is that it is all natural language thanks to Cucumber. For example,

Scenario: Search by title
Given that I am a common user
And I have a topic with a "title" of "test topic"
And I am on the Topic Search page
And I search for "test"
Then I should see "Results"
And I should see the topic "test topic"

You can see that it is very easy to follow, and it allows our limited-technical people to read User Stories features without worrying about understanding Ruby tests. Also, making a change, then seeing your entire test suite pass is a very reassuring feeling. Testing is so important here, that we actually write the feature first, and then change the code to make it pass.

It has been quite a bit to adjust to. I haven’t really had the opportunity to do Ruby development full time, and I am unfamiliar with Git, and OS X. I have already gone through the O’Reilly book on Gitwith my time on the train, and I am a few chapters into the Ruby 1.8 Pickaxe book. Textmate has been decent, and I could get used to it, however it definitely lacks some of the things Rubymine has. I do like the speed and lightness of Textmate. Case in point is when switching a branch in Git, it applies a bunch of deltas to files in your path, and Textmate just detects that files have changed and reloads them in your tabs. I anticipate that Rubymine would shit bricks and try to re-index your project. Rubymine has some impressive features for speeding up Cucumber development, and showing code coverage though, so I may use it yet again. My co-workers have all been very supportive of me using the tools that I am most comfortable with.

I am getting adjusted to life is adjusting here, but I miss everyone very much. My weekends are just a lot of downtime, with Kristin at work, and me trying to occupy my time. I’ll try and get out of my funk today with a car wash, and a haircut. Hope everyone is having fun down in the Atl!