Image source: Getty Images

It's hard to imagine two companies that are more different than GoPro (GPRO -0.57%) and Alphabet (GOOGL 0.35%) (GOOG 0.37%). Sure, they're both technology companies -- but that's where the similarities end. One is the world's second-largest company by market cap, while the other has failed to turn a profit over the past twelve months.

But that doesn't necessarily mean that Alphabet's stock is a better bet than GoPro's. For that, you need to view shares of each company through three different lenses.

Financial fortitude

While cash in the bank isn't that exciting to shareholders -- most prefer it either coming back in the form of dividends, or being reinvested for huge growth opportunities -- it's crucial to long-term investing success.

When hard times hit, companies with lots of debt and not much cash are caught between a rock and a hard place. They must narrow their focus to just pay the bills. Companies with lots of cash, on the other hand, are emboldened: they can outspend rivals to put them out of business, buy back their own shares on the cheap, or even make opportunistic acquisitions.

Here's how Alphabet and GoPro stack up in terms of financial fortitude.

Company

Cash

Debt

Net Income

Free Cash Flow

Alphabet

$77B

$6B

$18B

$20B

GoPro

$0.28B

$0

($0.22B)

($0.1)

Data source: Yahoo! Finance. Net income and free cash flow on trailing-12-month basis.

It should be noted that Alphabet is currently worth over 250 times GoPro, so such large discrepancies between the two companies aren't that surprising.

While GoPro's balance sheet is admirable for a company its size -- with zero debt to its name -- things haven't been going well. Since the company's failed execution with the Hero 4 Session -- which included two price slashes to move inventory -- cash on hand has fallen from $320 at the beginning of 2015 to where it is today.

Alphabet, on the other hand, has very little debt relative to cash, and is a veritable cash machine. It's easy to declare a winner here.

Winner = Alphabet.

Sustainable competitive advantage

Over my eight years as an investor, no metric has correlated as closely with my returns as the strength of the competitive advantages -- or moats -- of the underlying companies.

Alphabet has one of the strongest moats in the world: Google has seven products with over one billion users each, and with the exception of Facebook, no company can offer advertisers the same type of data for targeted ads than Google.

GoPro, on the other hand, is at perhaps the most crucial point in its history as a company. Currently, the only real advantage the company has is its brand name -- which has been sullied as of late. With more and more competition entering the action-camera market, there's a real threat that its technology could become commoditized.

The only real hope GoPro has is the formation of an ecosystem that has high switching costs. In effect, this would look something like a combination of editing and publishing technology only available with GoPro cameras, as well as the development of real content platforms for users to share their videos.

But where things stand today, Alphabet is the clear winner with the largest moat.

Winner = Alphabet

Valuation

Finally, we deal with how expensive the stocks really are. There are tons of ways to evaluate this, but here are four of my favorite metrics.

Company

P/E

P/FCF

P/S

PEG Ratio

Alphabet

25

27

6.7

1.3

GoPro

N/A

N/A

1.7

0.7

Data source: Yahoo! Finance, E*Trade. P/E is on non-GAAP basis. N/A=Not applicable

Normally, when a company lacks earnings and free cash flow -- as is the case with GoPro -- it would be the unanimous loser. But this presents an interesting case. GoPro has two new products coming out this holiday season that could be blockbusters and give the company a surge of cash. That's reflected in a PEG Ratio that's well below 1.0.

As such, I'm willing to call this a draw. Alphabet is somewhat expensive, but it also still has massive opportunities from the migration to ad dollars online. And if any one of the company's "Other Bets" pays off, it could be a huge needle-mover.

Winner = Tie

So there you go, Alphabet is -- by my estimation -- a much better stock to buy today. That helps explain why I've devoted almost 12% of my real-life holdings to Alphabet, and less than 2% to GoPro.