[Previous entry: "Linux for a dummy (Guess who?)"] [Next entry: "Revenge of popfile: Dude, where's my buckets?!"]
09/27/2004: "Names are important"
I often preach that names are important when I talk about programming. I am quite adamant about taking extra time to search for a better name, so that the code might communicate better to its prospective readers. At the same time, I decided to honor a tradition (of sorts) in the TDD community, with the example I used in both my tutorial JUnit: A Starter Guide and in my book JUnit Recipes: a class representing an amount of money. A reader recently pointed out to me what a horrible name Money is for such a class, being an abstract noun. The class, he reminds me, represents a quantity of money, not "a money." He's absolutely correct.
So I have performed the Rename Method refactoring on my sample code, from Money to MonetaryAmount. It's just unfortunate that I can't push that change out to the book. That's one drawback to publishing on paper: it gets so old so quickly!
