Ruby variable naming Ok, let's slow down and learn some basics about variable names Global variables start with '$' Class variables start with '@@' Instance variables start with '@' Local variables, method names, and method parameters start with a lower case letter Class names, module names and constants start with an uppercase letter Variables names are composed of letters, numbers and underscores Method names may end with "?", "!", or "=". Methods ending with a "?" imply a boolean operation (eg, "instance_of?"). Methods ending with "!" imply something dangerous, like strings being modified in place (eg, "upcase!") Interesting tidbits about Ruby, '#' is the line comment character, all characters after this are ignored. Confusingly '#' can appear within quotes with a different meaning. No semi-colons are needed to end lines, but may be used to separate statements on the same line A backslash (\) at the end of a line is used for continuation Indenting is not significant, unlike python Types of variables do not need to be declared Lines between =begin and =end are ignored Lines following "__END__" on its own line with no white space, are ignored A tiny demonstration of these: # sample program showing special characters like comments # I'm a comment line a = 1 #notice no semicolon and no type declaration b = 2; c = 3 #notice two statements on one line name = "Abraham \ Lincoln" # a line continued by trailing \ puts "#{name}" =begin # block comment I'm ignored. So am I. =end puts "goodbye" __END__ # rest is ignored 1 2 3 4