Saturday, March 22, 2008

evaluating the new hotness, Ruby On Rails

I've been getting up to speed in Ruby on Rails over the last 3 weeks, and I'm definitely impressed by the developer productivity you get with this framework. You can literally get a working data-driven website up in under 20 minutes. You can also slap a new front-end or look and feel onto an existing website in about 20 minutes. I like Rails' "convention over configuration" philosphy, having spent countless annoying hours with other web application frameworks and ORM layers tracking complicated bugs down to incorrect configuration. Ruby is easy to learn, and yields very clean, readable code. I'm not sure yet how excited I am about dynamic typing, but you can do some really clever polymorphic tricks. Overall, I like that RoR makes a handful of good software development practices the path of least resistance: test driven development, MVC component separation, etc.

If you're interested in learning RoR, I highly recommend Agile Web Development with Rails.

The biggest criticism I've heard about RoR is that it's slow. It is a bit slow, but it's also easy to make your code faster. We were recently optimizing a backfill process, and found that we could get a 10x speedup by replacing ActiveRecord.find with ActiveRecord.find_by_sql, forcing rails to not sanitize sql strings, and preloading queries that were called often but always yielded the same result. We used ruby-prof to figure this out.

My biggest criticism so far is the lack of a great IDE with RoR support. Lots of RoR people love TextMate, but it doesn't come with a debugger. I can only imagine living in a world without debuggers if I only ever worked on code that I wrote. You don't usually get this luxury in enterprise software. Ruby-debug works great, but by itself is a command line app that spits context to a console window, which is a bit awkward; and every time you start it up you have to setup your breakpoints again, which is time-consuming. I've heard you can hook it into emacs, but haven't tried that yet.

Eclipse has the Aptana plugin, but after using it for a few days I found it quite clunky. Auto-complete is really slow and error prone, search is awkward and not inline, navigation is awkward and really slow (this is more Eclipse's fault than Aptana's though), and most importantly the debugger is so slow that it takes 4 minutes to start itself up, and half the time fails to start up at all. This is unusable.

Next I tried Netbeans, and this is my favorite so far- it's fast and easy to navigate within, the search is inline, autocomplete is fast and actually works, the default shortcuts are intuitive, and the debugger actually works most of the time. Specifically, it works great for debugging the application and the unit tests, but gets confused and hangs on functional tests. I'll be curious to see if this is improved in Netbeans 6.1.

lots of beaches round here

A few weekends ago we went to Ocean Beach, in west San Francisco. The day was perfect, thousands of people were out, and you could see for miles. We found a few interesting shells, waded in the very cold water, and discovered that sand makes a pretty good chalkboard replacement. Here is Jason reciting his favorite proof of why the square root of 2 is an irrational number.





The sunset was beautiful, and the layers of far away clouds made the sun appear huge as it began setting, and morph into odd hourglass shapes as it finished setting. As we walked back up the beach to our car we passed a wedding party lining up on the beach.

Tuesday, March 4, 2008

My first day at the new job

I arrived at work yesterday morning, to find on my desk:
  • a vase of fresh flowers
  • a shiny new MacBook pro, with a set up and fully functioning development environment
  • a 30 inch computer monitor
  • business cards with my name on them
  • a gift certificate for dinner for two at Chez Panisse
And, last but not least, because my new job title is Web Ninja, they had also gotten me a set of nunchucks. This is going to be an awesome job.