...

/

Symbols

Symbols

An introduction to symbols, when to use them along with their difference from strings.

Symbols are like strings, except they are code.

Symbols are a rather strange concept to be honest, and we only introduce them because symbols are used so often and widely that you’ll very likely find them used in code elsewhere. For your first steps in learning programming we would not necessarily need them.

A symbol is written like this: :something

I.e. there is a word that is preceded by a colon. This means that normally symbols do not contain spaces. Instead, if we have symbols that consist of multiple words we would concatenate them with underscores, like so: :another_funny_symbol

...

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy