# Re: Variables starting with ":"

**URL:** <https://www.ruby-forum.com/t/re-variables-starting-with/81561>\
**Category:** Ruby\
**Created:** [January 9, 2007, 10:28pm UTC](https://www.ruby-forum.com/t/re-variables-starting-with/81561 "2007-01-09T22:28:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [January 9, 2007, 10:28pm UTC](https://www.ruby-forum.com/t/re-variables-starting-with/81561/1 "2007-01-09T22:28:52Z")

</div>

From: Eduardo S.

> What’s the diference between regular variables defined as, lets say  
> “example”, and the ones defined as “:example” ? If there’s a  
> difference,  
> when should each case be used?

Items that start with a colon are not variables, they are Symbols.  
Continue your research with that bit of information; there’s a lot out  
there on the difference between Symbols and Strings (in 1.8), and when  
to use them.

---

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [January 9, 2007, 10:50pm UTC](https://www.ruby-forum.com/t/re-variables-starting-with/81561/2 "2007-01-09T22:50:28Z")

</div>

Gavin K. wrote:

> From: Eduardo S.
> 
> > What’s the diference between regular variables defined as, lets say  
> > “example”, and the ones defined as “:example” ? If there’s a  
> > difference,  
> > when should each case be used?
> 
> Items that start with a colon are not variables, they are Symbols.  
> Continue your research with that bit of information; there’s a lot out  
> there on the difference between Symbols and Strings (in 1.8), and when  
> to use them.

Thanks a lot, Gavin. Now I know what to look for… I’ve never read about  
Symbols before on any of the books I’ve read so far.

Thanks!!

---

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [January 10, 2007, 1:25am UTC](https://www.ruby-forum.com/t/re-variables-starting-with/81561/3 "2007-01-10T01:25:09Z")

</div>

On 1/9/07, Eduardo S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > there on the difference between Symbols and Strings (in 1.8), and when  
> > to use them.
> 
> Thanks a lot, Gavin. Now I know what to look for… I’ve never read about  
> Symbols before on any of the books I’ve read so far.
> 
> Thanks!!

Be sure to check out this ridiculously long post on the subject. I’m  
still  
digesting it (seriously, it was crunchy at times, and it sits kind of  
heavy  
in the belly but it’s worth it. )  
[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/230723](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/230723)

---

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [January 10, 2007, 6:56pm UTC](https://www.ruby-forum.com/t/re-variables-starting-with/81561/4 "2007-01-10T18:56:50Z")

</div>

> Be sure to check out this ridiculously long post on the subject. I’m  
> still  
> digesting it (seriously, it was crunchy at times, and it sits kind of  
> heavy  
> in the belly but it’s worth it. )  
> [http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/230723](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/230723)

Fantastic! Thanks a lot for the link!! It was a really useful read!! 🙂

Which other links like this do you have there to share?? 🙂

Thanks again, Jason!
