"COMPUTER POWER TO THE PEOPLE! DOWN WITH CYBERCRUD!" - Theodor Nelson
Thursday, April 07, 2005
Use The Ummmmm Thesaurus, Luke
I was working on a little Ruby project tonight. Basically, it's a simple upcoming calendar for just me. Nothing special. So, I started with an Event object and it is responsible for representing a calendar entry. Now, it needed to know when it was to happen and some descriptions. So, I gave it 3 instance variables: when, title, and description. The next question was how was I going to represent when. I knew it needed to display itself and compare itself to other whens (for sorting). I initially thought of the name, DateRange, since it is responsible for holding a range of dates. But, I didn't like the name because I wanted to represent the concept of future dates and a single date. DateRange just didn't feel right because it seemed too specific. So, what do I do when I don't like a name for an object? I go to my trusty thesaurus for the answer! Within seconds, I had a page full of words and one jumped right at me: "MOMENT"! EUREKA! Moment was the perfect name for this new object. It conveys the meaning of its responsibilities exactly. This way I could have FutureMoments, DatedMoments, and even UndefinedMoments. I use a thesaurus a lot in my development lately and it's an idea that I got from "Thinking Forth". It's a simple and brilliant idea. It starts getting you to think about concise words to name the objects of your model more precisely. Anything that makes meaning clear and succinct is always good in my book!