
|
Using a Thesaurus
I find myself using a Thesaurus sometimes while coding in order to come up with variable and function names. So I usually keep a copy of Word open so that I can quickly switch and get a synonym/antonym. Does anyone else do this or am I just crazy.
Quixotic
Friday, November 7, 2003
You're just ape, barmy, batty, berserk, bonkers, cracked, crazed, cuckoo, daft, delirious, demented, deranged, dingy, dippy, erratic, flaky, flipped, flipped out, freaked out, fruity, haywire, idiotic, insane, kooky, lunatic, mad, maniacal, mental, moonstruck, nuts, nutty, potty, psycho, screw loose, screwball, screwy, silly, touched, unbalanced, unglued, unhinged, unzipped, wacky, whacko.
Philo
Philo
Friday, November 7, 2003
Yup, that's me :-(
Quixotic
Friday, November 7, 2003
Philo - you kill me.
However, I do question the original poster's sanity. ;)
Why would you want names that mean the same thing? I must be missing your point because I would be afraid of code with methods like:
assignRate
allotRate
assoicateRate
allocateRate
giveRate
consignRate
dispenseRate
MSHack
Friday, November 7, 2003
Philo,
You crack me up man :)
LOL
Friday, November 7, 2003
Why would you have all of those different function/variable names when you're just trying to come up with one unique name? Never happens. I simply can't believe no one has done this. Unbelievable.
Quixotic
Friday, November 7, 2003
Our code standards require that function names follow the same sort of convention verb{_noun+}, e.g. find_my_keys, put_money_in_my_wallet etc.
The part that is fuzzy is the get/put -- as long as we use the same convention for verb parts then we're OK. Like another user wrote, I'd hate to have programmers using different verbs when they really mean 'get' (fetch, select, locate, return, etc.).
And with classes/namespaces in .NET I don’t need to worry about having two functions called getName provided I’m using the right class it’s no big deal; and of course overloaded functions could be used such that the input parameter(s) type would decide which getName to fire.
So no, I’ve never used a thesaurus…
MR
Friday, November 7, 2003
That's not what I'm saying. Those are standard routines common to any database class. Getters Setters etc... I'm not talking about standard naming conventions. Let me give an example.
I had a structure that I initially called (to simplify things) 'Symbol'. I knew that it didn't totally describe what I wanted but at the moment I was busy coding the contents of that structure. Now I knew that symbol wasn't what I wanted so I went to Word and/or Thesaurus.com and typed in symbol. Lo and behold the word 'Glyph' turns up. This word more accurately described the structure and the intended goal of what the structure is used for.
Sometimes while coding you just can't think of the exact word you want to describe something, so I look it up in a thesaurus.
Your arguments of naming conventions and such are not relevant to using a Thesaurus to come up with a better descriptive name. It is a given that if I would then create a class 'CGlyph', I could make member functions 'GetGlyph', 'SetGlyph', 'SaveGlyph' etc etc. This is standard industry practice. What is not a given is that had I left the structure called 'Symbol' it would not have accurately described it's intended purpose.
Now you may be saying that this should be described in the specs and you shouldn't have to rename anything. Well sometimes it's not in the specs and sometimes you don't have specs and sometimes the specs are wrong.
Quixotic
Friday, November 7, 2003
Ah, I see what you mean now. If that's what you meant to say you should have said it the first time. :)
You're right, there have been times in which I don't know what to call something... Generally though it happens early enough in the development process that I end up thinking of a better term before too much code is written that relies on hard-coded function names.
What I try and do when I encounter a 'fuzzy' descriptor is just write the function prototypes and leave it be for a day or so whilst I code up less fluid sections of the code. Usually my subconscious will think of a better term by the time I'm ready to come back and flesh out the functions.
Of course, your coworkers are generally helpful in this regard. I ask other programmers/tech writers/managers (probably in that order) what they think; even if they don’t come up with a perfect name it’s usually enough to get me started down the right path.
MR
Friday, November 7, 2003
You're right, I apologize for not making myself clear.
Quixotic
Friday, November 7, 2003
I've used a copy of Microsoft Bookshelf 98 for years now. Copy the contents to your hard drive so on newer computers it starts instantly and gives access to a Thesaurus as well as other reference books. The 1998 Internet Directory isn't much use though!
Gerry Shaw
Friday, November 7, 2003
I do this too. I first heard about this suggestion from Alan Cooper's book "About Face: The Essentials of User Interface Design".
I think having better verbs and nouns can make your intention must clearer.
runtime
Friday, November 7, 2003
I use http://www.m-w.com for this all of the time. Sometimes I use the dictionary, sometimes the thesaurus. Coding is all about words man.
Wayne
Saturday, November 8, 2003
sometimes we make up just funny names, eg how to call a
prev next, you are on 2 of 10 pages, 1 2 3 4 5 more >> links bar on the page?
you can give any name, like "simher"
name not available
Saturday, November 8, 2003
What's another word for thesaurus?
Monday, November 10, 2003
The thesaurus in Merriam Webster doesn't have any entries for "thesaurus".
Stephen Jones
Monday, November 10, 2003
Recent Topics
Fog Creek Home
|