The market's recent correction looks like a massive drop on a year-to-date chart. However, it will look far less daunting in a decade; that's what happens over the long run. Bull markets last longer than downturns. This leads to relatively smooth (though not flawless) northbound trajectories and strong returns for most stocks over a decade or more.

Despite recent market volatility, buying shares of top companies that can at least match average returns through 2035 -- or do much better -- is still worth it. Here are two excellent candidates: Shopify (SHOP -1.60%) and Vertex Pharmaceuticals (VRTX 0.48%).

Person packing shipping boxes.

Image source: Getty Images.

1. Shopify

The world is constantly changing and evolving. Many businesses don't last long because they fail to change with it. Take the continued rise of e-commerce: Well-established brick-and-mortar stores have been driven to the brink of bankruptcy (or beyond) as retail transactions increasingly switch to online channels. Shopify is one of the companies helping drive this shift, as it allows merchants to create online storefronts, practically a necessity for success in our modern digital world.

E-commerce should continue growing over the next decade. In the U.S., it accounted for just 16.2% of retail transactions in the first quarter. That number will increase, and Shopify should benefit significantly.

For one thing, the company has been an innovator in its niche of the e-commerce market. It's now a one-stop shop for everything businesses need to start online stores. Shopify provides a slew of services, including marketing, payment processing, inventory management, and much more, so business owners can focus on other things. And it consistently generates solid and rapidly growing revenue.

For another, Shopify has a strong competitive advantage based on switching costs. Having a moat is necessary to perform well over the long run, and Shopify doesn't fall short on this front.

However, it still isn't consistently profitable, and there's stiff competition in the e-commerce market. Meanwhile, an economic downturn could affect transaction volume on its platform and, by extension, its revenue.

Yet Shopify should still perform well in the next decade as it makes headway in the large e-commerce market. Changes it implemented a few years ago -- notably, selling its logistics unit -- have allowed it to get much closer to profitability. And despite the competition, Shopify has grabbed more than a 12% share (by gross merchandise volume) of the U.S. e-commerce industry.

The stock might slow down in the face of economic issues, but those don't last forever. In the long run, Shopify should deliver superior returns.

2. Vertex Pharmaceuticals

Vertex Pharmaceuticals, a leading biotech company, has encountered some headwinds lately. In December, it failed to impress the market with phase 2 results for suzetrigine in treating painful lumbosacral radiculopathy (low back and leg pain caused by inflammation of nerves in the spine). More recently, Vertex's shares fell off a cliff after disappointing first-quarter results.

Even with those recent headwinds, the company's outlook for the next decade seems attractive. The biotech's portfolio of products remains the proverbial "only game in town" for patients with the rare lung disease cystic fibrosis (CF). Vertex is the only company that makes medicines that address the underlying causes of CF. That's still helping drive strong top-line growth.

The biotech missed expectations in the first quarter for two reasons that won't haunt it every period. It dealt with illegal knockoffs of its medicines in Russia -- a problem isolated to that country. And it incurred a noncash impairment charge related to an investigational drug for type 1 diabetes (T1D), VX-264, which it recently discontinued.

Meanwhile, Vertex Pharmaceuticals' already strong CF franchise recently improved with the approval of Alyftrek, a next-gen medicine. The company can still make significant strides in this market.

And Vertex is expanding its lineup beyond its core area. Recent approvals like that for Casgevy, a gene-editing medicine for two rare blood diseases, and Journavx, for acute pain, will help drive top-line growth. Even in T1D, Vertex's other program, VX-880, could hit regulators' desks seeking approval by next year. The company has several other medicines in development, some in phase 3 studies.

Vertex Pharmaceuticals may not have performed well recently, but at current levels, it's a great idea to buy the stock. Those who do so today should see strong returns through 2035.