John Blanco wrote:
> I'm new to Ruby, but coming up to speed quickly.  One question I still
> have never seen a good explanation to is this: When is it preferred to a
> key a hash with a symbol, and when is it keyed by string?  Is this just
> personal preference, or is there a rule of thumb?
> 
> For example, in the Rails book, the session variable is always populated
> with symbols, i.e.:
> 
> session[:user] = User.new
> 
> It's also obviously completely common throughout the Rails framework
> (e.g., :controller =>, :action =>, etc.)
> 
> So, when should I use what...or what should I prefer?

This question comes up a lot. You can search the list archives for 
comprehensive discussions. Try 
http://groups.google.com/group/comp.lang.ruby/browse_frm/thread/7e9a4d1cb55d1c1f/e495f6051aebe0ae?lnk=gst&q=symbols+strings&rnum=3#e495f6051aebe0ae

-- 
Posted via http://www.ruby-forum.com/.