Pledge 3 Percent for Rails 3

Saturday, April 10th, 2010

Has Ruby on Rails been good to you? Has the framework helped you get a job or start your consulting career? If so, I challenge you to give 3 percent of your time for Rails 3 over the next few months. If you work 40 hours a week, 3 percent amounts to less than 5 hours a month! Could you donate half a Saturday a month to the framework that figuratively puts money in your bank account? I can, and that’s why I’m pledging three percent for Rails 3 over the next few months.

The Bugmashes have been great, but there’s still more to be done. The core team is dedicated and smart, but they can’t do it all. As of the time of this post, there are 1199 open tickets in Lighthouse, 898 open bugs, and 301 open patches. Oh yeah, and by the way, Rails has been basically overhauled and re-architected in its entirety (You might want to kick the tires a bit).

Stop whining about bundler. Stop complaining about the new routing DSL. Instead of taking the time to talk about everything that’s going wrong, put in the time to make it right. Here’s why you should pledge your three percent today:

It Makes a Better Framework

How confident are you in a framework that has 1199 open issues that aren’t going away? How much better would the framework be if developers like Jose, Wycats, and Koz were freed up to focus on the bigger picture? If you use Rails on a daily basis, your unique perspective matters, and you can help with the burden of all of these open issues.

It Makes a Better Community

Negativity is contagious. You can sit on the sidelines and complain about what’s coming, or you can get in the game and help make things happen. What stinks is that if there’s an obnoxious crowd heckling the players on the field, newcomers will be less inclined to jump in. Positivity can be a virus in the same way. If you truly love what you do and you’re grateful, exhibiting that makes the community as a whole better and it attracts newcomers to the project.

It Makes You a Better, More Marketable Developer

Knowing the internals of the framework you use on a day to day basis definitely makes you a better developer. There is no magic behind Rails, just smart design and Ruby. Consider pair programming with someone more experienced than you and how that impacts your performance. Now, imagine working with the leaders of the community on core functionality and how that can improve your skills.

Consider the benefits from a professional perspective as well. Do you think being a core contributor differentiates you in a hiring decision? If you’re a freelancer, does that provide you with something marketable over those still on the sidelines?

Get in the game. Pledge your 3 percent today and give back.

Five Things You Can Do Today to Make Your App Ready For Ruby on Rails 3

Thursday, February 4th, 2010

Rails 3 is coming!

I’ve been doing a lot of thinking about how I can help clients get in a better position to upgrade to Rails 3 when it’s ready for prime time. There’s a few things you can do today with your 2.3.x application to give it more Rails 3 flava. Yeah boy!!!

Use Bundler instead of config.gem

Yehuda Katz has done a good job replacing config.gem with a more platform agnostic utility called Bundler. The API has changed around a bit with the latest 0.9 release, but he supplies a decent guide. For details on what’s changed since that writeup, check out this post from Yehuda

Use inherited_resources to get respond_with

respond_with will be a nice shortcut in Rails 3 for the rendering end of RESTful controller actions. Jose Valim’s inherited_resources actually gives you respond_with and respond_to methods for Rails 2.3.x applications. No more repetitive and un-DRY respond_to blocks

Use rails_xss

Unsafe strings will automatically be escaped by default in Rails 3. If you want this behavior in 2.3.x, all you have to do is install Koz’s rails_xss. It is surprisingly hard to break out of the habit of using h() calls in your markup, though! Additionally, be wary that you might have to hack some of your view related plugins to get them working with rails_xss.

Use More Named Scopes

Fortunately, ActiveRecord find() calls will soon be unfound in Rails applications. Pratik has done some really cool stuff with active_record. These changes are all pretty significant, but perhaps the largest deal is that the find() method and its relatives will be deprecated come Rails 3.1. One thing that is remaining a fairly consistent part of the API is named_scopes (despite a name change).

Developers should be encouraged to use named_scopes and association chains even more aggressively, now. It will certainly be easier to refactor a few named scopes around than it would be to refactor scattered find() calls all over your libraries. You should be doing this anyway, because it definitely helps with improving code and test quality

An excellent gem that can help you with this is Ben Johnson’s searchlogic. It gives you a bunch of very useful, canned scopes.

Replace references to RAILS_ENV, RAILS_ROOT, and RAILS_DEFAULT_LOGGER

Thankfully, these ugly constants have no place in a Rails 3 application. There are now methods to access these properties as part of the Rails module. So, for example, you would use Rails.env instead of RAILS_ENV

Nick Quaranto actually just wrote a solid article with the details on the Rails module.

Friday’s Software Enlightenment #4 – Rumble Edition

Friday, August 28th, 2009

The 2009 Rails Rumble was a huge event! The results are simply stunning with great apps like Lowdown and hi.im. It really is amazing what can be built in 48 hours. If you get a chance, please head over, register and vote on the Rails Rumble Site

So without further ado, here’s some tools I found immensely useful in the creation of my rumble app. I’d really like to write a full post mortem, but in the spirit of Friday’s short list of links, here goes:

  • SearchLogic – excellent derived named scopes and search form capabilities.
  • AuthLogic – my favorite authentication system out their for Rails today.
  • Formtastic – a great utility for generating forms quickly.
  • Inherited_Resources – Jose has done an awesome job with this helper that handles your typical (and not so typical) RESTful controller actions
  • Stringex – useful for permalinking
  • under_construction – a handy javascript utility I’ve written to quickly note what design elements need to be implemented from a development standpoint.
  • serverjuice – Great for getting an Ubuntu VM up and running quickly
  • SpreadHead – although it required some adjustments in the way it handles routes, I really think this is a great way to get a quick CMS integrated with your site. It’s definitely useful to have some editable pieces of your application when there’s a code freeze in 48 hours. I currently use it for CMS partials (a way to have editable content inside a page), but I do not for individual pages themselves. There’s an issue in the gem version where the routes are added to the top of priority instead of the bottom. I’m hoping to help with a fix for this
  • tab_menu – I always seem to need tabs or a nice menu system, so I use this code pretty frequently
  • ThemeRoller – easily roll JQuery UI styling.

The combination of formtastic, searchlogic, and inherited_resources has really changed the way I code. I think a post on the power of these tools in combination with chronic

Some of these tools and more are available in the Enlightened Template I maintain on Github. There were some updates after the rumble. I hope you find it useful!

Friday’s Software Enlightenment #2: Product Management Edition

Friday, July 31st, 2009
  • Bezos on Business and Zappos – A MUST WATCH – this was perhaps the highlight of my week courtesy of The Ted. I think Jeff really nails it on what makes businesses so successful today: you must obsess over your customers. I just found the talk really inspiring and informative. Take the 8 minutes to watch and learn from one of the best entrepreneurs of our time.
  • IShowU.app – This looks like great screencasting software. Screencasts are an effective way to show your users what they can do with your application. They’re also becoming quite popular learning tools for developers.
  • DHH Talks to FLOSS – David Heinemeier Hansson talks on a popular and well-produced podcast on how he got into development. He talks a lot about development mentalities and the need for establishing conventions. While I don’t always agree with David, I related to him in a lot of ways specifically around his business motivations overpowering his development aspirations. I found it really interesting.
  • UserTesting.com – I’ve been waiting for something like this for a very long while. Affordable, simple and effective usability testing really is just about observing user behaviors and listening to what they’re saying as they navigate. I haven’t tried this service yet, but I plan to do so in the near future.

Friday’s Software Enlightenment

Friday, July 24th, 2009

I’m going to regularly post links, discussions, and tips I’ve found helpful every Friday.

  • Version 2.3.3 of Ruby On Rails is Released – includes improvements to JSON and a touch command that allows you to update the updated_at timestamp for associated objects
  • Timecop – a really awesome gem that makes it easy to mock time related functions
  • JQuery Rounded Corners – I might be a bit late to the party on this, but rounded corners are so Web 5.0. Seriously, though the browser support for this plugin is impressive. I also like the api.
  • Giles on “Magic” Frameworks – I hear from a lot of programmers outside of the Rails community that it does too much “magic.” Giles’ thoughts are extremely poignant. I look at it this way: you drive a car every day. You put gas in it, get oil changes, etc. I don’t know everything there is to know about what’s under the hood, and chances are, neither do you. You have common interfaces with the automobile and all the smaller details have already been manufactured and put in place for you. A framework is definitely similar. Would a mechanic tell you that you cars run on “magic”? If you don’t understand something, that doesn’t make it magic.
  • Huddle’s Thoughts on Bootstrapping the development of a web app – Although I have to disagree on the usage of Elance, Guru, or design contests, there’s some good tips here. I’ve rescued many projects for clients that attempted to use inexpensive resources like those found on Elance. There is a similar lapse in quality when you run design contests. Credible and reliable help in building your application is the best investment you can make for your online property.