Home Variables

Variable type

Choose the type which is most appropriate for the data you are trying to represent. Use an int when you only need whole numbers, doubles when you need decimal precision, booleans for when you need a binary true or false value, Strings for arbitrary text, and so forth.

Variable phobia

Make liberal use of variables, especially to eliminate redundant and repeated expressions.

Scope variables tightly

Scope your variables as tightly as possible – declare them within the smallest set of curly brackets as possible.