Summary
In this chapter, you learned all about Ruby's different variable types. You learned how to use local variables whenever possible. You also learned how both local variables and instance variables can provide substantial performance benefits with intelligent caching.
Moving on, we covered that constants are just another type of variable and that both constants and class instance variables can replace the use of class variables. Finally, you learned about global variables and how to replace their usage with constants or accessor methods on singletons.
Most importantly, in this chapter, you learned when it is appropriate to use each of Ruby's variable types, and how to properly name them, which are two of the most important factors in writing Ruby programs that are easy to maintain.
In the next chapter, you'll build on this knowledge, and learn about methods and how best to use their many types of arguments.