International Business Machines (IBM 0.18%) and McDonald's (MCD 1.32%) are two classic blue-chip stocks. While the two companies may have little in common -- one is a technology giant and the other is a fast-food chain -- the stocks cater to similar kinds of investors. Both are among the 30 stocks in the Dow Jones Industrial Average, and are the types of investments that Warren Buffett favors. Buffett has been a big backer of IBM in recent years, and used to own McDonald's. Both stocks have big brand names, long histories, and some form of economic moat, or competitive advantage. They offer juicy dividend yields, and have favored shareholder-friendly policies, returning cash in dividends as well as share buybacks.

However, both companies have confronted challenges recently as innovative forces have disrupted their industries. The rise of fast casual has zapped some of McDonald's mojo, forcing it to regroup and adapt under new CEO Steve Easterbrook, making changes like offering all-day breakfast and eliminating human antibiotics from chicken.

IBM, meanwhile, has seen revenue steadily erode as its transition to cloud-based services has taken longer than expected. 

With those shifts in mind, let's take a closer look at each company to see which one is the better buy today.

Image Source: Motley Fool. 

A modern, progressive burger company

There's no question that CEO Steve Easterbrook has been a breath off fresh air for McDonald's. Before he took the helm last March, the company was reeling from sliding comparable sales in the U.S. as it lost ground to fast casual rivals, and in Asia due to a series of food safety crises.

The stock kicked off a rally last summer as it prepared to introduce all-day breakfast in the U.S., and gained more than 40% in a span of about seven months as the move sent U.S comparable sales soaring; but since then the stock, along with the company's performance, has slowed. Year-to-date, the stock is up just 3%, trailing the S&P 500 and the Dow. Comparable sales growth has slowed amid a general downturn in the restaurant industry, and it's beginning to look like Easterbrook may have already picked the proverbial low-hanging fruit.

Comparable sales growth in the U.S. was just 1.3% in the most recent quarter, and is likely to fall further in the fourth quarter as the company laps the launch of all-day breakfast. Overall revenue fell 3% in the quarter, in part due to currency translation and the company's focus on refranchising restaurants, the other pillar of Easterbrook's strategy. The company is in the process of selling off about 2,000 locations in China for an estimated $3 billion. Refranchising will alleviate capital expenditures, allowing the company to return more cash to shareholders, but it could also reduce profits over the long term. Refranchising has been a popular strategy in fast food lately as it helps reduce risk for the corporate parent, and has led stocks like Burger King-parent Restaurant Brands International and Wendy's to superior performances. 

Image Source: IBM.

Not so Big Blue

Back in the 1980s, IBM was the most valuable company in the country, but over the years the tech giant has ceded its leadership to internet giants like MicrosoftAlphabet, and Amazon.com. Under CEO Virginia Rometty, the company is undergoing a years-long transition to cloud-based services, selling off hardware divisions in the process, but it's been slower than expected.

IBM was forced to jettison a long-held target of $20 EPS in 2015 last year, and is instead on track for less than $14 in EPS this year. It's also seen revenue decline for 18 quarters in a row. While the stock is still down 15% from five years ago, investor hopes for a turnaround are increasing as shares have gained 20% this year. 

Even as it finds growth in what it says are more profitable segments, the company's operating margin has trended downward over the last two years. Management says that is due to investments such as acquisitions and data centers to scale up and build utilization. Through the first three quarters of the year, it spent $5.45 billion on acquisitions, including The Weather Company and Truven Health, which should help it return to growth. Its strategic imperatives delivered 16% revenue growth in the last quarter, and cloud revenue was up 44%, both positive signs. But with profits still falling, it seems like low expectations and a cheap valuation are the reasons for its recent rise.

And the better buy is...

At a P/E around 13, IBM is significantly cheaper than McDonald's, which trades around 22, and both stocks offer similar dividend yields at a little above 3%. However, while there's some evidence that IBM's strategy is beginning to take hold, analysts are only calling for modest earnings growth around 3% next year and revenue is expected to be flat. IBM may be finally breaking its streak of revenue declines, but it's not about to come roaring back.

McDonald's, on the other hand, seems to be in the hands of a capable leader who is making smart decisions to modernize the company. Through the first three quarters of the year, earnings per share is up 15%, and refranchising restaurants should help boost cash flow in the near term.

I wouldn't expect blockbuster returns from either of these stocks, but because of its leadership, I would consider McDonald's to be the better buy of the two.