Simberon Design Minute
 

Confusing Letters

I'm usually pretty good at figuring out methods quickly. Even if I don't understand the reason for the code, I can at least quickly tell which words are variables and which are messages. So, I was surprised the other day when I encountered a Smalltalk method that I couldn't quickly parse. There were expressions that seemed to start with vertical bars. It took me a minute to realize that a block parameter was named "L". I've already mentioned that you shouldn't use single letter variable names, but this rule is especially true when the letter is a lowercase L or an uppercase I. Both of these letters are very difficult to distinguish from a vertical bar. The same would apply to an uppercase "O" which is similar to zero. Ambiguities like this can really slow down your understanding of a method.

Download