Sunday, January 18, 2009

A matter of style...


I've seen plenty of code examples that show how to set the current user or subdomain to a variable. For example:


However, I prefer this way:


With this technique, I always use the current_user method to determine the current user, and never reference the @current_user variable. If an action doesn't need to know the current_user, no time is wasted to set it.