Contact Me
Rails Recipes
My Job Went to India

I’m always looking for ways to get humans together for meaningful (potentially lasting) interactions at our conferences. So we’re trying something new this year during the tutorial day. It happens on the first (or 0th?) day of the conference on purpose: so the work can continue for the rest of the conference. My hope is to bring project owners/committers together with aspiring contributors and bring more people into the fold of projects which need help. Think of it as a room full of code sprints happening all at once. Here’s the description:

Project Owners: Do you have a project you’d like to work with other people on? Maybe it’s an established Open Source project. Maybe it’s a new idea. Come find like-minded developers and spend the day hacking together.

Developers: Are you looking to get involved in an Open Source project but need a bootstrapping session to get you started? Looking for chances to meet other developers and establish collaborative working relationships? Looking to learn by collaborating with others? Come find a project and spend the day sitting side-by-side with one or more of its developers learning the ropes and contributing code.

RailsConf is the largest physical gathering of Ruby and Rails developers internationally. Let’s take advantage of all being in one place at the same time AND take the chance to give something back to the projects and community which we so greatly benefit from.

In the morning, project leaders and representatives will have a chance to make a short pitch for their projects and the work they hope to get done. For the rest of the day, groups will self-organize and write code! Roll up your sleeves and prepare to learn, teach, and most importantly, contribute.

Go to this page and add your project or idea to the list of projects likely to be active in the Code Drive.

RailsConf 2007 Keynote Videos

January 28th, 2008

Now available!

Scanning through the videos this morning, I was reminded of what a great time I had at RailsConf. Planning is well underway for RailsConf 2008 (keep your eyes peeled for registration to open soon). An initial batch of proposals have been selected, and I’m already excited about the program this year.

The Rails community is maturing, and the level of proposed content has matured along with it. Expect more advanced content this year from a more experienced (obviously) group of practitioners.

Seeya there!

Advanced Rails Recipes

December 17th, 2007

You may remember that I was working on Advanced Rails Recipes earlier this year. I’m not anymore. I’ve been over-committed and I finally decided to face facts and withdraw myself from the authoring process.

That’s OK though. Someone has pressed the “Kick Ass” button on the Mike Clark book-writing machine, and Advanced Rails Recipes has appeared in beta.

The book is a collection of recipes by Mike and top members of the Rails community. There is literally no one I trust more to put together timely, trustworthy advice on how to develop Rails applications right more than Mike. This one is a must-read, and beta is a great time to get in on the action in that it gives you a chance to make an impact on the final product.

The book is not yet complete, but it’s already worth the price.

RailsConf Proposals

December 16th, 2007

There were more proposals for RailsConf this year than there were attendees at RubyConf 2006. This means two things:

1. The state of the Rails community has changed significantly in that it has grown and there is a larger subset reaching the expert level.

2. It’s going to take us a while to sort through all of these proposals and make selections. Apologies in advance.

Ruby on Leopard

October 28th, 2007

Today I installed Apple’s latest OS release: Leopard. One of the most exciting features for me as a Rubyist is the inclusion of a well-designed Ruby installation, complete with RubyGems and a bundle of pre-installed gems for the software I typically use as well as some of the Mac-specific gems most Rubyists would like to have (dnssd, rubycocoa, etc.)

Some of the gems shipped with Leopard are slightly out of date, as can be expected. But since they shipped the software as gems, updating Rails (for example) was as simple as ‘gem update rails’.

Apple has shipped Ruby as one of its Frameworks and has provided first-class integration with its development tools for the first time. They’ve been working with us in the community for nearly a year to get this right and it shows. Kudos to Apple and especially to Laurent Sansonetti and Jordan Hubbard for a job well done.

I can finally remove that extra non-Apple Ruby install I’ve been carrying around for years now and just use the Apple-supported Framework.

(FYI, Giles has completely jumped the shark on this one. Don’t let his poo-pooing worry you.)

Scotland On Rails

October 17th, 2007

When I was in middle school, my friends and I started a rock band. We picked a name; we had a logo. If we’d had money the next obvious step would have been to print band t-shirts. This all happened, of course, before we ever learned to play any relevant instruments (saxophone and bassoon don’t count).

For well over a year, I’ve been wearing a Scotland on Rails shirt. Scotland on Rails has a name, a logo, and t-shirts.

Now they’ve got a conference.

Organized in part by my good friend and big thinker, Alan C. Francis, Scotland on Rails is sure to be a great time. If you’re in or around the UK, I highly recommend putting it on your calendar (or at the very least considering a mouse pad or pair of boxers).

As I mentioned previously, Marcel Molina and I are doing a full day testing workshop for charity at RailsConf Europe next month.

Dr. Nic Williams hopes to attend but rather than donate the required minimum $75 directly, he has chosen to auction off his MyConfPlan web site and to then donate the proceeds as part of his registration for the tutorial.

So now’s your chance to kick start your way into Web 2.0 entrepreneurship, help Dr. Nic fulfill his goal of learning more about testing, and develop good karma all in one action.

You can bid here.

It’s easy to give money. It’s much harder and more personal to give your time, passion, accomplishments, and creativity. Dr. Nic is a shining example for the rest of us. Thanks, Nic!

RailsConf Europe is right around the corner, and on the first day Marcel Molina and I will be doing a full day tutorial on advanced Ruby and Rails testing techniques. And, in the tradition of Dave and Mike’s Rails Guidebook, we’ll be requesting a minimum $75 tax deductible donation to charity of all those who attend. At RailsConf this year we raised $33,000 for charities, and we hope the spirit of giving continues.

I travel a lot and meet a ton of Ruby and Rails developers in the process, and I’m always surprised at the seemingly unquenchable desire for testing information. So we’re hoping that an entire day with a couple of developers who have been seriously passionate about testing will help at least plant a few seeds and satisfy some of the demand. The fun part is that we’ve both learned new tricks ourselves as we’ve prepared. That’s one of the selfish joys of being a speaker, trainer, and author. No matter how well you know a topic, you always learn things when you go to prepare a tutorial, talk, article, or book on that topic. And, as we all know, testing and test-driven development is a deep topic.

As always, even if you’re not planning to attend, feel free to give to the cause.

Ruby Hoedowned

August 12th, 2007

Friday and Saturday, I attended the first Ruby Hoedown at RedHat HQ in Raleigh, NC. The Hoedown was one of many regional Ruby conferences popping up all over the place driven in small part by Ruby Central’s conference grant. Nathaniel and Jeremy did an excellent job putting the conference together. It was flawlessly executed with an exciting program and a good dose of southern charm.

Here’s a braindump:

Testing Workshop for Charity – $3200

The conference pre-started with me, Bruce Tate, and Marcel Molina giving a two and a half hour testing workshop for charity. Taking a queue from the Dave and Mike’s Rails Guidebook, participants gave a donation ($50 recommended) to attend the workshop. We ultimately raised roughly $3200 for the Food Bank of Central and Eastern North Carolina. A large portion of the workshop consisted of me and Marcel interactively improvising the development of an application in test-first style while drawing the questions, comments, and criticism of the audience. The format worked well (from our perspective), and we covered a lot of great material. We’re really looking forward to our FULL DAY testing workshop for charity at RailsConf Europe in Berlin next month. (Next month’s workshop goes to support Habitat for Humanity. We’re happily accepting donations regardless of whether you attend.)

Merb

The main conference kicked off with a talk from Ezra Zygmuntowicz about Merb. Merb started out as a complement to Rails—-something you whip out when you need multi-threaded request processing, such as big file uploads and long-running application logic. Rails isn’t always well suited to this sort of thing, because Rails is single threaded. To scale, you have to add more processes, which adds a potentially unhealthy amount of memory overhead. Merb is a multithreaded, lighter weight Mongrel-bound (for now) framework.

Now, however, Merb is turning into a full-blown Rails clone (Actionpack clone really). I remain fully skeptical. I understand Ezra’s stated reasons for doing it (along with a few implicit ones I think), but I think we already have a Rails, and incremental improvements are, well, incremental. It would be nice to see someone taking a leap as opposed to a step. Even before Rails came out, I think the industry had seen enough MVC. I am hopeful that some of Ezra’s improvements make it back into Rails. His desire to keep things lean and unmagical is commendable.

Adhearsion

Next up was Jay Phillips, whose Adhearsion framework for VOIP applications completely blew me away. Adhearsion is a perfect example of someone taking a powerful domain with a historically ridiculous development model and taking a full evolutionary step forward. Jay’s framework takes developers from what literally looks like the dark ages (have you seen an Asterisk dial plan?) to a beautiful and powerful API with modern automation wrapped around it.

We Rubyists have been looking for another killer app following Rails. Adhearsion might be it. Seeing Jay speak made me realize that we have that same combination of disdain with the current state of affairs, courage to slap the (telecom development) industry in the face, intelligence to innovate a solution which brings programmer joy and the people skills and marketing sensibility to push it over the edge. If you care about Ruby, watch Adhearsion closely.

The Journey – Bruce Tate

The day closed with Bruce Tate giving a keynote on the direction of Ruby. He drew some interesting parallels to past technologies and also led us through a series of scenarios about where Ruby and its community might be headed. The most convincing one can be summarized as using Ruby to build elegant APIs on top of existing problems which do for those problems what Rails did for web development. See Adhearsion.

Building Games With Ruby

Andrea O. K. Wright from Chariot Solutions gave a surprisingly thorough and engaging talk which ended up being a survey of the various game libraries available for Ruby. I’m an avid gamer and got interested in computer programming because I wanted to be a game developer, so I’ve taken this tour myself a few times. But it’s been a while and I was simply amazed at how far things have come. As Andrea spoke, I downloaded literally every library she was discussing and tried them out. I had some problems with the SDL bindings on my Mac, but I had instant success with both Gosu and Shattered Ruby. I’m not sure if we’re ready for Unreal Tournament-style games in Ruby but simple games are finally, well…simple to create. Definitely check out Gosu if you even have a passing interest. Really fun.

Lightning Talks

There were a series of quick lightning talks. They were good, but there were too many to enumerate. I’m liking this format more and more every time I experience it.

Ruby For Change

During lunch Jeff Casimir and I organized a “BoF” (I hate that term) on Ruby for Social Change. Jeff booked the smallest spot, thinking we were going to be a tiny crowd, but we ended up cramming a large group into the room. The discussion was lively and loud and the people were passionate. With only 45 minutes to talk, we came out of the meeting with some ideas about organizing volunteers to give their time to produce real applications for non-profits/charities who could use the projects to make impactful change. More on this soon I hope. We have a RubyForge project set up for the group.

If you’re interested in this topic and interested in helping to shape what we do, please do drop in and sign up for the mailing list once it’s activated. The first order of business (in parallel to doing things like setting up a web site) is to find a project with a real customer to rally around. If you have ideas, we’d love to hear them.

Does Ruby Have a Chasm to Cross?

I was skeptical because of the title of this talk, but I trusted that Ken Auer was going to deliver something interesting, and my skepticism turned out to be ill-founded. Ken is an old Smalltalker and one of the leaders in both the patterns and agile movements. His talk was a well-thought-out history of Smalltalk and ultimately a comparison to Ruby’s adoption curve. I won’t do this one justice with a summary, but I recommend watching it when the conference videos go live on the Confreaks web site.

Using C to Tune Your Ruby (or Rails) Application

Jared Richardson gave a really engaging and fun talk on extending Ruby with C. It was review for me, but the audience was totally into it, and 2 out of 6 people who Nathaniel asked to tell one thing they were excited about learning at the end of the conferenced cited material from Jared’s talk. It’s easy to forget how elegant and human-friendly Ruby’s C API is. If you’re the kind of person who has a natural aversion to that kind of thing and have been avoiding it, you really should take a Saturday morning to crack open the Pick Axe and go through some of the C extension examples. I think you’ll be pleasantly surprised. Lots of potential gain for not much pain.

What Makes Beautiful Code?

I’m not going to say much about this, because I hope to take this topic into a separate post, but Marcel’s ideas from this talk have already changed the way I think about my own code as I write it. Those that know Marcel and have worked with him know that he is obsessed with keeping code beautiful. Whether it’s a shell script, a systems programming task, or a high level API, he creates some of the most consistently beautiful code you’ll see in Ruby-land. In this talk, Marcel decided to take this passion for beauty and try to more clearly define the elements that make code beautiful. The result is a small but useful framework for measuring trade-offs when developing software. I’m looking forward to seeing these ideas develop. The keynote itself was short but the Q&A and discussion about it expanded such that Nathaniel ultimately had to cut it off. Obviously a topic that inspired much passion.

I Am Not A Werewolf

This time literally. We took a group to a nearby hotel and played Werewolf until around midnight. If you don’t know Werewolf, you owe it to yourself to try it. We played 5 nights straight at RailsConf this year, and I feel like some lasting bonds were made with people who I might not have even met otherwise. I think our community is too cliquey and fragmented sometimes, and Werewolf is a powerful tool (yes I’m talking about a game and saying “powerful”) for changing that.

We’ll be trying to put together a game again in a couple of weeks at The Rails Edge in Chicago. If you’re coming to the Rails Edge, read up on the rules before-hand and join in. If you’re not yet signed up it’s not too late.

Thanks to last night’s players and my (some-of-them) new friends Lyle Johnson, Tony Devlin, Jim Meyers, Chris Redinger, Evan Light, Devin Mullins, Carl Youngblood, Coby Randquist, Joe Martinez, Rick DeNatale, Ted Behling, Ryan Daigle, and Marcel. I hope to see you guys around soon.

If you’re in the South, I highly recommend watching for an announce of the second Ruby Hoedown. Until then, keep your eyes glued to RubyConf.

It seems like a long way away, but The Rails Edge is coming to Chicago on August 23-25.

The Rails Edge content continually changes, which makes this a favorite for speakers as well as attendees. Looking at the fresh lineup of talks, this is going to be the best one yet. When you get a group like this together:

Dave Thomas

Mike Clark

Justin Gehtland

Stuart Halloway

Marcel Molina Jr.

Jim Weirich

Ezra Zygmuntowicz

me ;)

...it’s bound to be both education and entertaining.

Anyway, the early bird registration ends July 1. People tend to get distracted during the summer and miss this kind of thing. Here’s registration if you’re interested.

Seeya there!

Hi. I wanted to clear something up.

On the last day of RailsConf, it appeared to attendees that Dan Moniz didn’t show up for his security talk. It turns out we never actually told him his proposal was accepted. Our fault. Please spread the word. Dan would have loved to speak (he proposed a great looking talk on Rails security).

The attendees of the then-quiet session stepped up and converted it into a lightning talk round (which is cool, because we had hoped to fit one more in). Hopefully we’ll see Dan speaking at next year’s conference.

If you want to be totally up-to-the-second in tune with what’s happening at RailsConf, our friends at Twitter have set up an excellent flash-based visualizer. Click it to have it take over your screen. Sit back, and let the hours pass. Let it mesmerize you.

In case, for some reason, you have to get up for your computer, you can follow the railsconf user on Twitter with your cell phone by texting “following railsconf” to 40404.

If you add railsconf as a friend, railsconf will add you as a friend. This is the New Rails Community: We friend you back.

Babbling in Portugese

May 10th, 2007

Brazilian Rails expert and author, Fabio Akita I recently did an interview with me for his Portuguese Rails weblog.

I bet you didn’t know I was fluent in Portuguese, did you?!

If, for some reason, you don’t read Portuguese, he’s been kind of enough to translate the interview into English here.

Fabio has an excellent interview style. I really enjoyed it and I think it came out really well. Fabio has been doing a ton of other interview lately in an effort to shine a light on Rails in Brazil. If you read Portuguese, keep an eye on his interview category.

What do you have cooking on your Rails project? The community wants to know!

When the first Rails Recipes book was written, most of the Rails knowledge was concentrated in a small group of experts. These days, with new Rails applications being launched almost weekly and so many different problems being solved, the State of the Art is more evenly spread across the community. In order to capture what’s happening in the Rails community, we’d like the second Rails Recipe book to incorporate advanced recipes from the community’s best and brightest.

So here’s your chance to share tasty dishes that others may have never imagined they could make. We (Mike and Chad) will help you prepare your recipe for inclusion in the upcoming Advanced Rails Recipes book, including reviewing and testing the code, and you’ll get all the credit.

To propose a recipe idea, here’s all we need from you:

  • A paragraph or two describing the problem that the recipe solves
  • A sentence or two indicating what the solution will be
  • You should already have working code. You can send some along if it helps convey your idea.

Email your idea to us at railsrecipes@gmail.com by May 25th (but if you’ve already got an idea in mind, go ahead and send it today!). We’ll review your idea and let you know by May 31st if we can fit it in the book. After that, we’ll start working together to get your recipe into the book!

If your recipe is selected, your name, bio, and link to your site/blog will appear in the book. And you’ll receive a complimentary copy of the book, of course.

These days, with all the buzz around rich browser-based client development, our applications are more and more likely to include a large number of external resources. Beautiful little icons, JavaScript infrastructure and effects libraries, and external CSS files add up quickly. As soon as you add a line such as:

<%= javascript_include_tag :defaults %>

to your Rails application (never mind whether this practice is optimal—it’s pervasive), the browser has to download several separate files to completely load a single page.

I’m pretty far to the left on the premature optimization continuum, so I wouldn’t worry about this kind of thing unless it were a problem. It turns out it really is a problem. Especially if your application is being accessed via HTTPS. Not only does HTTPS add the overhead of encryption and encryption to your request, but browsers will not cache resources requested via HTTPS. This leads to very noticeable performance issues—the kind your users complain about (and rightly so).

It turns out this problem is even worse than I previously realized. According to this page (which I found out about in the patch I’ll mention in the next paragraph), most browsers impose a limit on how many connections can be made to a single named host at any given time. And on the internet’s most popular browser, this number is a whopping two. Add to this the fact that HTTP Pipelining is disabled by default, and a resource-heavy page is a recipe for a sluggish user experience.

So it was with great interest that I noticed this change late last night in Edge Rails. Jeremy Kemper checked in a new feature allowing Rails developers to configure multiple asset hosts using a numbered naming convention.

As a refresher, the ActionController::Base.asset_host variable tells your Rails application to generate external resources’ links pointing to the host of your choosing. This is a good way to ensure that your Mongrel or FastCGI process isn’t being asked to serve static content.

With Jeremy’s change, you can now do this:

ActionController::Base.asset_host = "http://assets%d.example.com"

This tells Rails to generate links to the following four hosts: assets0.example.com, assets1.example.com, assets2.example.com, and assets3.example.com.

Keep in mind that for this technique to be effective, you don’t have to configure four separate machines to respond to these requests. Simply creating these four DNS aliases and pointing them at one server will still make a difference, since the browser per-host limitations are per name—not per IP.

UPDATE: According to Dan Kubb and DHH, setting the Cache-Control and/or Expires headers properly on your web server will get around the SSL caching issue I mentioned above. Somehow I must have gotten it wrong when I tried on my own. Thanks for pointing that out, guys!