Simberon Design Minute
 

Undeclared Variables

In Smalltalk, it's possible to get undeclared variables into your code and have it still appear to work. Sometimes it happens when you're writing new code to reference a variable and forget to declare it later but most often it happens when you're cleaning up code and rename or delete variables without changing the methods that reference them. You should frequently check your undeclared variables and clean them up. An undeclared instance or temporary variable will behave like a global and will have unexpected behavior. Undeclared globals are usually references to classe that don't exist. They'll contain nil and can cause exceptions in your application.

Download