.comment-link {margin-left:.6em;}

Undisclosed Recipients

Location: San Diego, California, United States

Sunday, August 07, 2005

"The" and "That"

I'm reading Bruce Eckel's Thinking In Java now, and I'm at the point where he introduces Singleton. I've tried, and kind of liked, the word "The" for the function that returns the singleton instance:

app = Application.The();

It seems clear and easy to remember. But I don't use Singleton often enough to have much of a sense of whether this is better or worse than other terms.

I'm also using "that" a lot; I find a lot of my methods compare "this" with something else, or involve an interaction with something else of the same type. It flows naturally to say

if (this == that)

and it's also convenient that "this" and "that" have the same length, so code lines up neatly:

if (this.foo > that.bar
 || that.foo > this.bar)

These terms remind me of HyperCard's delightful "it".