RFS: Constants, Snake Case and Camel Case - 010
In this episode we talk about constants, and why the distinction between snake case and camel case is important in ruby.
In ruby constants are anything that start with capital letter. So inside of a class we can define a constant or even the naming of the class itself is a constant and starts with capital letters.
TYPES = ['game', 'food']
In this case we have a constant TYPES that holds the array with 2 values.
Snake Case / Camel Case
Having a clear distinction between snake case and camel case is important in ruby, this is because if we define something starting with a capital letter they will be regarded as 'constants', so if we're assigning something to a variable it's important to use snake case.
variables_are_snake_case = "yay"
puts "important distinction"
ConstantsAreCamelCase = "awesome"
# defining classes are also done with Constants
That's all for this episode!