Home Segments Index Top Previous Next

100: Mainline

Spaces, tabs, and carriage returns are called whitespace characters. Smalltalk is blank insensitive because Smalltalk treats all sequences of whitespace characters—other than those in character strings—as though there were just a single space. Thus, the following are equivalent:

Integer method definition • instance 
fatToCalories 
  ^ self * 9 
Integer method definition • instance 
fatToCalories     ^     self     *     9 

Neither of these layout options can be said to be “best” or “official.” In fact, experienced Smalltalk programmers argue heatedly about how to arrange methods to maximize transparency and to please the eye. In this book, the methods are written in a style that both uses paper efficiently and lies within the envelope of common practice.