On Nov 5, 2013, at 12:20 AM, Jordon Bedwell <envyge...@gmail.com> wrote:

> On Tue, Nov 5, 2013 at 12:07 AM, Sur <sur....@gmail.com> wrote:
>> Do you know what is the difference between a string and a symbol and why and
>> where symbols are preferred over strings ?
>> 
>> try this:
>> 
>> a = "some string"
>> b = "some string"
>> b.object_id == a.object_id  (watch for the result of this expression)
> 
>> sym_a = :some_symbol
>> sym_b = :some_symbol
>> sym_b.object_id == sym_a.object_id  (watch for the result of this
>> expression)
> 
> Preach on about this bullshit when Ruby isn't primarily used for web
> applications and when Ruby allows my system to reclaim memory, until
> then lets leave the symbol argument bullshit out of this.  Even if
> they are constants they can lead to trouble if you just blindly state
> they are better without explaining the dangers in a web application,
> or people will repeat history, history people like me thought was
> already common knowledge.
> 
> — 

Wow, is this response ever out of context. The example Sur supplied had to do 
with how code is stored in memory, IN RESPONSE TO the question of whether code 
is in memory or not (see "caching"). 

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/FDA3FF80-6748-4F97-9137-120DC695813C%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to