I Want My IDE

Posted by Ryan Baxter Fri, 10 Aug 2007 02:32:00 GMT

The majority of my academic and professional programming career has been spent writing code using an integrated development environment (IDE). I’ve dabbled with Eclipse, Microsoft Visual Studio, Macrodobe Dreamweaver, and various Borland products. Rather than juggle multiple text editors and source control consoles, I find it easier to stay organized using an IDE on large projects. When editing config files or writing scripts I prefer a lightweight text editor. In Linux, vi or gedit is my choice. Notepad2 is at the top of my Windows list.

A few months ago I decided to learn Ruby and the Ruby on Rails framework. I began with the obligatory Hello World program and quickly progressed through a series of tutorials using vi and gedit to get the job done. Since then, I’ve begun some larger projects and am quickly finding myself losing focus and missing the benefits of an IDE. Consulting Google, I compiled a list of prospective IDEs to begin my evaluation. I’m willing to give each of them a fair chance at becoming my Rails development environment, but have a few questions before I begin. What, if any, IDEs have I missed? How long should I try each one?

Needs (in order of importance):

  1. Linux compatible
  2. Project Browsing
  3. SVN integration
  4. Syntax Highlighting
  5. Code Completion
  6. Active Community
  7. Unit Testing
  8. Debugging
  9. Auto-indent
  10. Plugin support
  11. Less than $100

The list:
*Each IDE/editor was capable of Project Browsing, Syntax Highlighting, and compatible with Linux.

  1. Aptana RadRails
    Pros
    • Good SVN integration.
    • The latest Beta has working Code Completion.
    • Built on Eclipse.
    • More Rails features than Eclipse + DLTK.
    • Many plugins inherited from Eclipse
    • Free.
    Cons
    • Code Completion is broken in the current stable release.
    • Built on Eclipse.
  2. Eclipse + DLTK
    Pros
    • SVN integration.
    • DLTK has Code Completion.
    • Tried and true.
    • Vast library of plugins.
    • Active community.
    • Free.
    Cons
    • Eclipse is slow and consumes a lot of memory.
  3. FreeRIDE
    Pros
    • Auto-indenting.
    • Debugging.
    • Free.
    Cons
    • No SVN integration.
    • No Code Completion.
    • Performance could be an issue b/c it’s a native Ruby application.
  4. gedit + plugins
    Pros
    • Lightweight.
    • Plugins.
    • Free.
    Cons
    • No SVN integration.
    • No Code Completion.
  5. jEdit
    Pros
    • SVN integration.
    • Code Completion.
    • Plugins.
    • Free.
    Cons
    • Not user friendly.
  6. IntelliJ IDEA 6.0
    Pros
    • SVN integration.
    • Code Completion.
    • Debugging.
    • Unit Testing.
    • Plugins.
    • Much more…
    Cons
    • $249.
  7. Komodo IDE 4.1
    Pros
    • SVN integration.
    • Code Completion.
    • Debugging.
    • Built specifically for Ruby on Rails.
    • Much more…
    Cons
    • $295
  8. Mondrian Ruby IDE
    Pros
    • Lightweight.
    • Free.
    Cons
    • No SVN integration.
    • No Code Completion.
    • Performance could be an issue b/c it’s a native Ruby application.
    • Spam in support forum.
  9. NetBeans Beta 6.0 Milestone 10+
    Pros
    • SVN integration.
    • Code Completion.
    • Debugging.
    • Plugins.
    • Free.
    • Much more…
    Cons
    • Beta.
  10. Ruby IDE from CodeGear
    Pros
    • CodeGear experience.
    Cons
    • Feature set not yet released.

I’ll be evaluating each of the IDEs/editors in turn and publishing my results as a series. Feel free to leave feedback and check back soon!

Code Snippet: Ruby Word Masher

Posted by Ryan Baxter Sat, 28 Jul 2007 20:54:00 GMT

I can be extremely indecisive about things. So much, in fact, that I even wrote a script to help me choose a name for this website. Is it strange that a random number generator can make me feel better about making decisions? My wife thinks I’m crazy, but she also calls domain names, donames. Besides, I think there is something novel in a computer choosing a name for itself. Anyway… Given some user input, the code below will read words from a file and then mash them together to provide unique combinations. Here is a words.dat file to help get you started. Happy mashing.

#!/usr/bin/ruby

words = Array.new
i = 0

def mash_words(words, mash_count)
  new_word = ''

  1.upto(mash_count) do
    new_word += words[rand(words.length)]
  end

  return new_word
end

begin
  puts 'How many mashed words would you like to create?'
  word_count = gets.chomp.to_i  

  puts 'How many words would you like to mash?'
  mash_count = gets.chomp.to_i  

  input_file = File.new("words.dat", "r")
  while (line = input_file.gets)    
    words[i] = line.chomp    
    i += 1
  end  

  1.upto(word_count) do    
    puts mash_words(words, mash_count)
  end  

  input_file.close  
rescue => err
  puts "Exception: #{err}"
  err
end

Code Snippet: Fibonacci with IronRuby & WPF

Posted by Ryan Baxter Thu, 26 Jul 2007 04:28:00 GMT

On Tuesday, John Lam announced the Pre-Alpha Release of IronRuby. To satisfy my curiosity, I downloaded and compiled the source code found on his blog. A simple Build.cmd file was provided and made the compilation a breeze. Rather than write another Hello World, I decided to kick the tires by writing a simple application to calculate Fibonacci numbers. I didn’t use many of the niceties that make Ruby what it is, but I did, however, uncover some oddities between Ruby and .NET types. I coded around a few of the problems only to find other features that were either broken or missing. The release was labeled “Pre-Alpha” for a reason so don’t be surprised if you have a similar experience with IronRuby.

I have to admit that I felt a bit dirty hacking together bits of the Windows Presentation Foundation (WPF) with Ruby only to achieve a single, ugly window with one text box, some words, and a button. It wouldn’t have been so bad if only I could have managed to use the .NET HorizontalAlignment enumeration with the controls on my window. Every effort I made in aligning a control caused an Exception. Defining the Orientation of my StackPanel also resulted in an Exception. Taking input was easy. Performing validation on the input was not. I could not get a string comparison to work between .NET and Ruby string types. I tried a half dozen combinations of .ToString, to_s, and Convert.ToString with no success. I gave up and wrapped my problem expression in a begin-rescue block.

begin
  fibonacci_label.content = fetch_iterative_fibonacci(Convert.ToInt32(input_text_box.Text)).to_s 
rescue
  MessageBox.show('Please enter an integer.')
end

If Microsoft creating their own implementation of Ruby isn’t interesting enough, John Lam has said that IronRuby will be hosted at RubyForge. His reason for this is simple. John believes that Open Source developers have more experience using Subversion rather than Microsoft’s Team Foundation Server. I agree and believe this decision will only benefit IronRuby by involving the whole Ruby community. This will most likely cause those non-Microsoft developers to contribute who otherwise wouldn’t if the project were hosted at CodePlex. Check out episode 254 of .NET Rocks! for more on this and John Lam’s work on IronRuby and the Dynamic Language Runtime.

I am not disappointed with the status of this release. Since IronRuby will be open for community contribution, the code will be reviewed by many eyes and the bugs that I did encounter will be fixed quickly. The integration of IronRuby and WPF was not pleasant, but I do believe that over time the two technologies could compliment each other nicely. The power of the presentation foundation combined with Ruby’s syntax sugar will undoubtedly make for an impressive stack that could give others a run for their money. Now can I have this in Mono please?

Both an iterative and recursive solution can be found within my source. I provided both in the odd chance that somebody reading this might want to try a rudimentary O(2^n) performance test between the Ruby interpretor and IronRuby. The source code for my Fibonacci example can be downloaded from the links below.

Fibonacci.tar.gz
Fibonacci.zip

Older posts: 1 ... 5 6 7 8