New to Rails 3? Check out the Ruby on Rails 3 Tutorial book and screencast.

A book and screencast series showing you how to develop and deploy industrial-strength Rails apps in a direct, step by step way. The screencast series includes 12 lessons over more than 15 hours! Get the best "over the shoulder" experience of following what a top Rails 3 developer does when building an app today. Click here to learn more.

The 15 Step Rails Code Quality Checklist

In Elsewhere, Tips

tickbox.pngThe Ruby on Rails Code Quality Checklist is a 15 point "quality checklist" for Rails developers to run against their Rails applications by Matthew Paul Moore. It's a year old, so predates Rails 2.2 and 2.3, but it recently made the rounds at the main social bookmarking sites, and I felt it was worth bringing up.

The first 5 of Matthew's points - in a very basic summary - are:

  1. Each controller action only calls one model method other than an initial find or new
  2. Only one or two instance variables are shared between each controller and view
  3. All model and variable names are both immediately obvious (to a new developer) and as short as possible without using abbreviations.
  4. All custom "finds" accessed from more than one place in the code use named_scope instead of a custom method.
  5. A .find or .find_by_ is never called in a view or view helper.

To learn the rest, you'll need to check out his article. He doesn't just list the points. He goes into further detail about every one. A great read.

[ad] railsjumpstart.pngJumpstart Lab is offering Rails Jumpstart, an introduction to Ruby on Rails, on 10/31-11/1 in Washington, DC. Save $30 with code "rubyrow"!

Post to Twitter Tweet This Post

Vaguely Related Posts (Usually)

3 Comment Responses to “The 15 Step Rails Code Quality Checklist”

  1. #1
    Hampton Says:

    100000% agree with this.

    I think people talk way too little about these kinds of code quality issues. Reminds me that I should go do some refactoring till that's true for Wikimedia. :P

  2. #2
    jofr Says:

    This is a rather poor list.

  3. #3
    Peter Cooper Says:

    If you can come up with a better one, I might link to it. Or I'd at least add the link here.

Leave a Reply