Software investors wanted to return to their old habits this week, bidding up the already wildly expensive shares of young software stocks and acting only slightly satisfied with stellar results from that old timer Microsoft (MSFT) - Get Report

Despite this week's trading, though, investors should avoid the ultra-expensive names like Twilio (TWLO) - Get Report and Okta (OKTA) - Get Report  for now and instead bet on tech's mega-caps -- in particular, Microsoft and Alphabet (GOOGL) - Get Report , which have much more reasonable expectations. 

Consider the disparity of new versus old on Thursday. Both ServiceNow (NOW) - Get Report , a fifteen-year-old maker of software tools for IT, and Microsoft, a 44-year-old legend, beat earnings and revenue expectations. 

The results were certainly fine for both, but vastly more impressive for Redmond, with Microsoft beating revenue expectations by a cool $900 million and earnings per share estimates by 14 cents, while ServiceNow was just $200,000 above consensus on revenue and 4 cents higher per share on earnings.

But ServiceNow stock surged, jumping more than 8% on Thursday to close at $237.78, while Microsoft rose a mere 2% to close at $139.94.

What happened to ServiceNow's even younger peers was even more remarkable. Shares of several high flyers, which had been under pressure of late, soared in sympathy. Twilio, Okta, Zscaler (ZS) - Get Report , MongoDB (MDB) - Get Report , Yext (YEXT) - Get Report , PagerDuty (PD) - Get Report  and Zoom Video Communications (ZM) - Get Report , among others, each surged between 4% and 7%. 

As TheStreet pointed out last week, Twilio and the other cloud software darlings are quite pricey. And the notion that the merely OK results of ServiceNow somehow mean they are off to the races is a mistaken one. These shares are all pricey and need to correct further as a risk-off attitude continues beyond today. In contrast, very solid results from Microsoft, and what will likely be solid results from Alphabet on Monday, Oct. 28, argue for those two as the most reliable, fairly-valued names to focus on. 

The cloud stocks are slightly more expensive than they were when the Street wrote cautiously about them recently. For example, Twilio trades for 320 times next year's projected earnings per share of 33 cents, up from 318 times, while Okta trades for 22 times projected revenue for the fiscal year ending in January, up from 20 times last week. 

Those numbers are certainly well above the valuations of Microsoft and Alphabet, which each trade at about 22 times next year's projected earnings per share. On a revenue basis, Microsoft and Alphabet are dirt cheap, trading at 7.6 and 4.6 times projected sales, respectively. Yes, the duo are growing a little more slowly, given their scale, with Microsoft expected to see revenue rise perhaps 11% this year and Alphabet around 19%, compared to 41% for Okta this year, for example. 

In return, however, the absolute level of sales for these mega-caps is meaningful because it's the amount of cash in absolute dollars that can be used for things such as returning money to shareholders. Alphabet doesn't pay a dividend, though from time to time it repurchases shares; its latest program is a $25 billion authorization to buy back stock, announced in July with its earnings report.

And Microsoft regularly buys back shares and also pays a dividend every quarter, currently 51 cents per share per quarter, a current yield of 1.5%. (More on Microsoft's investor relations page.)

The smaller fry, of course, can't afford to pay dividends, and aren't at this time, paying out in any way. They need to reinvest capital in their operations, as young companies must.

Leaving aside capital returns, one can ask why a dollar of revenue for Okta, say, should be worth multiples of what it's worth in the case of Microsoft and Alphabet. An argument on behalf of the cloud stocks such as Okta would be that more of their revenue is of a recurring nature compared to Microsoft and Alphabet, since the cloud darlings are running subscription software businesses. That would make their revenue in some ways more predictable than traditional "transactional" software sales.

That's good and true, but increasingly, Microsoft and Alphabet have been monetizing their technology by selling their own cloud computing offerings. We don't know how much they add up to, because neither Microsoft nor Alphabet disclose actual numbers for their cloud offerings. But it probably is multiple billions for each.

And so, with Microsoft and Alphabet, one has a combination of a couple of things that make them nice risk-off investments. Solid, proven businesses that both take advantage of the cloud but also leave lots of capital for shareholder returns, whether through dividends or share repurchases, and all at a valuation that is much less than nose-bleed. 

With those admirable attributes, it's likely Thursday's surge in the smaller names like Twilio was another head fake, and that more money will be flowing in the direction of Microsoft and Alphabet for the duration of this year.

Save 57% during our Halloween Sale. Don't let this market haunt you; join Jim Cramer's Investment Club, Action Alerts PLUS. Click here to sign up!

Twilio, Microsoft and Alphabet are holdings in Jim Cramer'sAction Alerts PLUS Charitable Trust Portfolio. Want to be alerted before Cramer buys or sells these stocks? Learn more now.

Tiernan Ray neither trades nor owns any shares of any companies mentioned in this article.