Changes

written about 2 months ago |
3 comments

Thoughtbot Christmas, 2007

I’ve worked in a few different types of environments in my career (academia, start-ups, Japan, doing good, working for the man, etc), but I can honestly say that I’ve never enjoyed my work, or my coworkers, as much as I have while I’ve been working with the team at Thoughtbot.

Thoughtbot understands the Ruby on Rails culture in a way that I’ve always respected. As a company, they focus on producing good work for both the clients and for the community. As a team, they foster an incredible amount of camaraderie and team spirit, without needing to stifle differences of opinion.

Setting out

All of this has made my recent decision to leave the company incredibly difficult. While Thoughtbot has been the best environment I could have hoped for, the need to set out on my own and build something for myself was just too strong.

I will be doing agile Ruby on Rails consulting for a few clients, and will soon focus on developing my own suite of products. While I’m currently fully committed, I’d be happy to discuss new opportunities and give referrals. I will also be posting my journey, and my development thoughts here, so stay tuned.

If you’re an incredible developer, and interested in living in the Boston or NYC areas, then I cannot recommend a better company to work for.

Vegas, Baby!

written about 2 months ago |
1 comment

I’ll be at RailsConf for the week of May 4th, so buy me a beer if you’re in town.

Here are some of the presentations I’m looking forward to in particular:

And a quick shout out to my friend Eric Mill, from The Sunlight Foundation, who’s hosting the Open Government Hackathon. (And I think they’re still hiring, by the way.)

Introspection

written about 2 months ago |
0 comments

We give training classes at Thoughtbot, and one of the common issues I’ve seen is that there are many more examples of good ruby library code than there are of decent Ruby on Rails applications. A Rails application follows conventions and best practices that aren’t relevant to writing library code.

To that end, I’ve released the source to this blog on github.

Here be Dragons

I spent a little bit of time cleaning the code up, but here is the big disclaimer:

This is my playground. I try to keep the code somewhat clean, but I also experiment quite a bit. Not everything in here exemplifies best practices.

Domain Explosion

written about 2 months ago |
6 comments

There’s an AntiPattern that I still see in the wild far too often: the overly normalized domain. It’s easy to spot – you find over 50 files staring you down after opening the app/models directory in what should have been a basic Rails application.

A simple example is the following domain snippet, showing a Product model with all the trappings that surround it.

Each of Condition, Color, ProductState and ShippingType are separate models, with separate tables, separate factory definitions, unit tests, RESTful controllers, migrations, etc.

And each is responsible for a single name column.

That’s a lot of code. The more code I see in an application, the sorrier I feel for the client. Code is a liability. Like a pack mule, the development process becomes bogged down, cumbersome, and eventually comes to a halt due to an overburden of code.

A much simpler solution is to reduce each of those models into columns on Product, using validations and named scopes to give all the benefits of the domain above:


class Product < ActiveRecord::Base
  COLORS = %w(Red White Blue)

  named_scope :colored, lambda {|c| {:conditions => {:color => c}}}
  validates_inclusion_of :color, :in => COLORS
end

Even the Photo model can be reimplemented this way, if you use the fantastic Paperclip plugin.

Developers, not coders.

It sounds absurd and even self defeating, but our job as developers isn’t to write code. Our job is to produce value for the client, and more often than not that means removing code.

That requires a whole lot of judgment, which translates to a whole lot of experience.

Behavior, not nouns.

The idea of removing classes in favor of values doesn’t fly in the face of good Object Oriented practices. The important distinction is that the classes above have essentially no behavior. A class without behavior is just a glorified value wrapped in maintenance costs.

Behavior, not vocabulary, dictates normalization. The moment you add a shipping_rate method to the Product model, you know you should migrate to a ShippingType class. The moment you have to be able to modify that price at runtime, you move to a model.

Simplest thing possible.

That’s the beauty of the BDD way. BDD teaches you to write your specs first, and produce the simplest thing possible in order to get them to pass. It also keeps you focused on producing business value for your client – something a domain explosion definitely doesn’t do.

The Plug

Chad Pytel and I delve into issues just like this in our upcoming Addison Wesley book, Rails AntiPatterns. Stay tuned for more information on the book, or for more posts like this.

Rockin' JAX with Hashrocket

written about 8 months ago |
0 comments

Hashrocket recently honored Joe Ferris (no relation) and I by an invitation to come down to Jacksonville Beach, Florida to work on one of their 321 Launch projects as guest star programmers.

Chris O’Sullivan actually did an amazingly accurate job of describing the project from a technical point of view by doing an impressively detailed analysis of our github commits and tweets.

We had a lot of things going for us in this project: The clients were a breeze to work with; Desi and Lark were both great developers, and a lot of fun to pair with; and the end product, Spot.us was going open-source – meaning there was no room for “cowboy antics” (Desi’s words).

The client was very impressed with the progress we had made, and with the overall polish of the site. You can read more about the reaction here, and the demo video is below.

Working at Hashrocket was a lot of fun, and in many ways was the perfect vacation. You’re surrounded by talented coders (which fends off the normal vacation boredom), and you get to wake up to beautiful beach views every morning.

Mememe

written about 9 months ago |
1 comment

  • Take a picture of yourself right now.
  • Don’t change your clothes, don’t fix your hair…just take a picture. (should be super-easy with Photobooth)
  • Post that picture with NO editing.
  • Post these instructions with your picture.

(It’s “formal friday”)

Testing named_scope

written 11 months ago
0 comments

Quick vim svn blame snippet

written about 1 year ago
5 comments

Getting back into the swing of things.

written about 1 year ago
2 comments

Email your Backpack GTD items

written about 1 year ago
0 comments

Politiquotes - Who said what, when, and where

written about 1 year ago
0 comments

Shoulda 4.0.1 - the lean and mean release

written about 1 year ago
0 comments

Upcoming conferences

written about 1 year ago
0 comments

Rails Rumours

written about 1 year ago
1 comment

Elephants

written about 1 year ago
0 comments

Switchpipe

written about 1 year ago
0 comments

37 Signals introduces line breaks

written about 1 year ago
0 comments

A couple of small, but totally useful plugins

written about 1 year ago
0 comments

Rescuing Net::HTTP exceptions

written about 1 year ago
4 comments

Shoulda in Advanced Rails Recipes

written about 1 year ago
0 comments

Version Control and “the 80%”

written about 1 year ago
0 comments

Book Review: Troubleshooting Ruby Processes by Philippe Hanrigou

written about 1 year ago
0 comments

Almost Painless Nested Resources

written about 1 year ago
0 comments

Remember your MVCs

written about 1 year ago
0 comments

RubyEast '07

written about 1 year ago
0 comments

My Second Markup & Style Meeting

written about 1 year ago
0 comments

Serving 138 Emails a Second

written about 1 year ago
0 comments

Ruby East

written about 1 year ago
0 comments

Moved to Mephisto

written about 1 year ago
0 comments

Trunk Mephisto, Edge Rails, Piston, and Mongrel. Oh, My.

written about 1 year ago
0 comments

Time may be money, but so is morale

written about 1 year ago
1 comment

Brittle Tests

written about 1 year ago
0 comments

Shoulda news

written about 1 year ago
0 comments

Programming as fate

written about 1 year ago
1 comment

Specin rSpec with Rails

written about 1 year ago
0 comments

Shoulda gets busy with your controllers

written about 1 year ago
0 comments

Introducing the Shoulda Testing Plugin

written about 1 year ago
0 comments

It's the little things...

written about 1 year ago
0 comments

Highrise to LDAP Gateway

written about 1 year ago
1 comment

cruise_control.rb campfire plugin

written about 1 year ago
0 comments

And then there was...

written about 1 year ago
0 comments

Campfire API Where Art Thou?

written over 2 years ago
2 comments

Presenting at RailsConf 2007

written over 2 years ago
0 comments

And apparently...

written over 2 years ago
0 comments

ActiveResource from javascript

written over 2 years ago
0 comments

Memories...

written over 2 years ago
0 comments

Battle over testing strategies over at thoughtbot

written over 2 years ago
0 comments

Ennui

written over 2 years ago
1 comment

First rails patch!

written over 2 years ago
6 comments

Quick snippet to add to the top of your environment.rb file

written over 2 years ago
0 comments

LDAP Server for ActiveRecord Models

written over 2 years ago
0 comments

Mocking a network resource with camping

written over 2 years ago
0 comments

Yay!

written over 2 years ago
0 comments

Second refactoring of security roles

written over 2 years ago
0 comments

I heart Ruby

written over 2 years ago
0 comments

Hyperlinks to specific emails in other applications.

written over 2 years ago
0 comments

LDAP Server for ActiveRecord Models

written over 2 years ago
2 comments

Thread safety in Rails and ActiveRecord

written over 2 years ago
2 comments

Using wrapper classes with ActiveRecord to enforce security rules

written over 2 years ago
0 comments

heh...

written over 2 years ago
0 comments

Am I crazy?

written over 2 years ago
0 comments

I had no idea...

written over 2 years ago
0 comments

Command line utility to interrogate models

written over 2 years ago
0 comments

acts_as_graph

written over 2 years ago
1 comment

Now, don't be hatin'

written over 2 years ago
1 comment

migration data dumper on rubyforge

written over 2 years ago
0 comments

Migration Data Dumper Plugin

written over 2 years ago
0 comments

Someone snarfed my plugin!

written over 2 years ago
0 comments

Migration data dumper plugin

written over 2 years ago
0 comments

Helloooo!

written over 2 years ago
0 comments