Imagine going back in time just 20 years. Cellphones were only starting to get really popular -- and they were used almost exclusively for phone calls. Text messaging hadn't even caught on by 1998! The very idea that you'd soon be able to access the Internet wirelessly with a computer you could slip into your pocket would have seemed so futuristic as to be absurd.

And yet, that that science fiction-like scenario is exactly what we got, and the two companies we're comparing today -- chipmaker and patent-hoarder Qualcomm (NASDAQ:QCOM) and Gorilla Glass-maker Corning (NYSE:GLW) -- both played major roles in the evolution of the now-ubiquitous smartphones.

The back of a smartphone with half of the internal components showing

Image source: Getty Images

Now smartphones have taken over the world, and both businesses continue to benefit. But are either of their stocks a good buy? If so, which is the better choice? Let's investigate the question by looking at each through three different lenses.

Sustainable competitive advantages

If you're a long-term, buy-and-hold investor, there's no aspect of a company that you should devote more time to analyzing than the strength of its sustainable competitive advantages -- in other words, its moat.

While Qualcomm undoubtedly benefits from the economies of scale that come with being a mammoth chipmaker, those alone do not constitute a moat. The key advantage this company has lies in its patents. But the power it wields via those patents has generated some intense pushback in recent years, notably in the company's battle with Apple

As my fellow Fool Evan Niu wrote last year:

Apple's lawsuit represents an existential threat to Qualcomm's licensing business, since Apple argues that the very structure of its royalty agreements is wholly inappropriate (despite Qualcomm having hundreds of similar agreements with smartphone manufacturers all around the world). If Apple were to win in court, manufacturers could revolt en masse, seeking more favorable terms.

Feeling the pressure, Qualcomm has shifted its focus more toward selling chips directly to companies, rather than licensing its technology -- but even there, the company is running into intense competition from the likes of Intel

Corning, on the other hand, is often associated with the super-stable Gorilla Glass used to make screens for smartphones and flat-panel TVs. But the company is far more diversified than outsiders may realize. Last quarter, the display technology division accounted for just 29% of total sales. It's the optical communications unit that now provides the largest share of revenues -- 35% last quarter. That unit's products include the optical fiber, cable and telecom solutions that allow telecoms and enterprise customers to move enormous volumes of data. The rest of the company's revenue comes from its environmental technologies, life sciences, and specialty materials divisions.

While the optical communication market -- thanks to explosive growth in data usage and video streaming that shows no signs of slowing -- obviously offers enormous opportunities, and Corning has a leading position and a well-financed R&D operation, it has no obvious moat other than its patents. And while it held over 8,700 patents worldwide at the end of last year, patents alone aren't the strongest moat.

Winner = Tie

Financial fortitude

Next, investors should evaluate how will equipped a company would be to cope if a major crisis were to crop up -- in either a macroeconomic or company-specific scenario. Based on the strength of their balance sheets,  companies can be split into three categories: the fragile (companies that would break), the robust (stay the same), and the antifragile (grow stronger). Read more about those distinctions here.

Keeping in mind that Qualcomm is almost four times the size of Corning by market capitalization, here's how the two stack up.

Company Cash Debt Free Cash Flow
Corning $3.4 billion $4.8 billion $40 million
Qualcomm $39.6 billion $19.4 billion $3.7 billion

Data source: Yahoo! Finance. Cash includes long and short-term investments. Free cash flow presented on trailing twelve-month basis.

In this category, we have a very clear winner: Qualcomm. The company is already trying to put its cash hoard to work by buying out NXP Semiconductors, a move that could widen its moat, but investors are waiting on Chinese officials to give the deal a thumbs-up.

While Corning's debt load is nothing that investors should seriously worry about, it doesn't have the same opportunities to use its cash in times of distress -- repurchasing shares or acquiring rivals, for instance -- that Qualcomm does.

Winner = Qualcomm

Valuation

Finally, we wade into the murky waters of valuation. While many view a company's price-to-earnings ratio as the alpha and omega of valuation, I believe in gauging several data points to build out a more holistic view.

Company P/E P/FCF PEG Ratio Dividend FCF Payout
Corning 17 620 1.7 2.6% 1,700%
Qualcomm 17 24 1.2 4.3% 90%

Data source: Yahoo! Finance, E*Trade. When applicable, non-GAAP earnings used to calculate P/E.

Here again we have a clear winner: Qualcomm. While the companies are about even on a P/E basis, Qualcomm has a much larger and more sustainable dividend. While Corning is expected to return to a cash-flow-positive status soon, Qualcomm overall has a more attractive valuation. 

Winner = Qualcomm

My winner is...

So there you have it: Qualcomm is not only a better bargain based on its  valuation and bigger dividend, but its balance sheet also provides much more strength than Corning's.

Having said that, I'm not particularly optimistic about either company. Their reliance on patents, and their positions in the value chain -- consumers like their smartphones, but don't really care who provides the parts so long as they work and aren't too expensive -- give me pause. That's why I don't own -- nor am I willing to make an outperform CAPS call on -- either company.

If you're trying to decide between the two, though, I think Qualcomm is a safer bet.

Brian Stoffel has no position in any of the stocks mentioned. The Motley Fool owns shares of and recommends Apple. The Motley Fool owns shares of Qualcomm and has the following options: long January 2020 $150 calls on Apple and short January 2020 $155 calls on Apple. The Motley Fool recommends Corning and NXP Semiconductors. The Motley Fool has a disclosure policy.