When facing specific naming challenges, I've found a thesaurus (online or paper) to be very helpful.
As for building up the skill:
Read lots of (high quality) programming books. The authors of these books will have put quite a bit of thought into the naming of variables and functions specifically to make the code as clear as possible.
More importantly, authors will generally have years of experience with the conventions common to the language or technology in question and will tend to use good idiomatic naming.
Of course, variables like
bar are very common (and for good reason!) when explaining syntax to separate developer-supplied names from language keywords. But most books will cover some meatier stuff by the end and will have realistic examples.
Also specifically read books like Code Complete, The Pragmatic Programmer, and other such books as they specifically address these issues of programming craft.
Reading lots of high-quality source code to see good examples is also a great idea, but now your task is even harder: finding high-quality source code!
I can't help adding: You might also be surprised how much great vocabulary for describing things you find in fiction - especially science fiction.
You say you don't want to just "read a lot of books", but that's my answer anyway. It's not going to get any easier than that. Any other method may be equally effective, but it will not be more efficient or as easy.
After thinking about this some more, I should also add that this is one of those skills you gain by doing more than studying. Good naming is part of the programming practice itself.
Thinking really hard about your naming while you're doing it is building up that skill. Here are some things I personally try to concentrate on when naming:
- What is the shortest unambiguous name for this thing?
- Would namespacing allow me to have better local names?
- Does this fit the problem domain itself or some technical aspect of the code? (Favor the problem domain for naming, if you can.)
- Am I being redundant? (
- Will this name make sense to me a year from now? (This question is hard.)
- Does this cover the general case? (
- Is this too general? (
- If I were describing this to a friend, is this the word I would use? If not, why not?
The list goes on.
It takes years and years to get really good at naming. You will cringe at 5 year old code. Then five years after that, you'll cringe again. Repeat.
Also, don't be afraid to rename stuff later. Most often, the "glaringly-obvious" correct name for a thing doesn't become glaringly-obvious until you've lived with it for a while!