Tag: Ruby

Rake vs. Ant

I wrote a big build script in Rake.  Rake is make for Ruby.  The syntax is basically just Ruby.  Coding in Ruby is pretty easy.

I replicated my rakefile in Ant.  Both the rakefile and ant script work fine but programming in Ant doesn’t feel right.  I was happy to find libraries like ant-contrib that make it possible to do if/then/else type logic in Ant, but coding in XML just feels unnatural.  The good news was that working in Ant wasn’t as bad as it could have been.  Ant tasks are pretty well documented.  Coding custom ant tasks in Java was easy.  It is possible to use scripting in Ant (javascript or ruby or maybe others).  I experimented with it but didn’t end up using the code in the end.

If I had to choose one, it would depend a lot on the environment I was in.  If everyone was already used to using Ant then I’d probably go with Ant.  Likewise for Rake.  If neither was used and we were starting from scratch, I’d pick Rake for sure.

Advertisement

A Smalltalker’s impression of Ruby

I’ve been using Ruby now for over half a year so I feel like I have a big enough time sample to be able to roll up my impressions of Ruby from a Smalltalker’s perspective.

Ruby the language was easy to learn.  I knew Smalltalk, Java, C# and various other languages.  The syntax is like Java.  The concepts are like Smalltalk.  It wasn’t much of a transition at all.

The IDEs are bad.  Working in a text editor is skinny but the different between skinny and naked isn’t much.  I also use Eclipse with the Aptana plugin loaded and that makes Eclipse only slightly better for Ruby development.  Senders, references, implementers are all missing.  File search feels like a step back to the C# style of development.  Ugh.

Documentation is good but…  I miss using the code as documentation like you do in Smalltalk.  I don’t want to go look at the Rubydoc website to see how to read a file.  Instead, like I would in Smalltalk, I want to look at the implementation of File.new() and then find senders of it to get examples.  All in the same code.  Still, the documentation is pretty good.

Scripting is easy with Ruby.  It should be but that doesn’t always mean much.  In Ruby’s case, it really is easy to write scripts without a big IDE in your way.

There are too many ways to do the same thing.  One of the things I hate most about Ruby is that there are several ways to do everything.  This makes it easy to write code the way you want.  It also makes your code messy as different developers write different sections of the code using completely different syntax styles.  Yuk.

Libraries in Ruby are similar to Smalltalk or Java.  Rake (like make).  UnitTest (like SUnit or JUnit).

Debugging in Ruby is terrible.  I haven’t found a interactive debugger.   Debugging via print statements is like working 20 years ago – it works but not nearly as well as using a good interactive debugger.