"When all you have is a hammer, every problem looks like a nail." -- Anon.

Ah, but what if the problem really is a nail? Then, friends, what you have in hand is just the tool for the job -- and that's the happy dilemma that McDonald's (NYSE:MCD) CEO Jim Skinner finds himself in today.

Waiter? There's a nail in my fries
Skinner did his darnedest to put on a frownie face at Wednesday's annual meeting of shareholders, musing that he'd much rather be doing business "in a robust economy." While the CEOs at Home Depot (NYSE:HD), UPS (NYSE:UPS), and FedEx (NYSE:FDX), are all on record saying the worst is nearly over, Skinner insists the U.S. economy is "not at a bottom."

Whatever's going on with the rest of the economy, though, McDonald's seems to be doing alright. As fellow Fool Alyce Lomax described yesterday, the company is making inroads into Starbucks' (NASDAQ:SBUX) coffee empire with a new line of "McCafes." Global same-store sales were up 6.9% in April, and even Skinner concedes: "Our momentum is continuing into 2009."

The question is whether McDonald's is succeeding despite the tough economy... or because of it.

"We operate from a position of strength in this environment," says Skinner
I'd argue the latter. As its CEO admits, recessionary times may be tough on companies like Whole Foods (NASDAQ:WFMI) and Cheesecake Factory (NASDAQ:CAKE) -- but they're tailor-made for a restaurateur whose piece de resistance is headlined "Dollar Menu"

Why? A wise man once said: "People gots to eat." If, when they open their wallets, they're more likely to see moths flutter out than $50 bills, they'll probably do more eating at Mickey D's than at the steakhouse Morton's.

Now, everybody knows that hard times are good for bad food. (Sorry, McDonald's, but we've all seen Super Size Me by now; the secret's out.) What you might not have heard, however, is that bad times are good for savvy operators -- and McDonald's is one of the savviest. Although the company's not opening new locales quite as fast as in years past, McDonald's President Ralph Alvarez says the company is taking advantage of the global decline to pick up attractive properties.

Foolish takeaway
Take lower costs to rent a set of Golden Arches, an economy that's driving some customers through 'em, and the aroma of fresh coffee attracting others, and I think I see why McDonald's is doing so well. And why McDonald's shareholders should be begging: President Obama, please do fix the economy, but ... no great rush, y'know?

Here's another bite of our McD's commentary and more:

FedEx, Starbucks, and Whole Foods are Motley Fool Stock Advisor recommendations. Home Depot and Starbucks are Inside Value selections. UPS is an Income Investor recommendation. The Fool owns shares of Starbucks.

Fool contributor Rich Smith does not own shares of any company named above. The Motley Fool has a disclosure policy.