There was a time HP (HPQ 0.16%) and IBM (IBM -1.05%) were not only two of the largest tech companies on the planet with long, storied histories, but head-to-head competitors in the desktop and enterprise hardware markets. But those days have since passed

Today IBM is more likely to run into HP spinoff HP Enterprise out in the field introducing its cloud, data analytics, cognitive computing, security, and mobile solutions. IBM's push into new, cutting-edge markets would seemingly earn it the nod considering the PC market -- HP's key revenue driver -- is dying, right? Not so fast.

Image source: HP.

The case for HP

CEO Dion Weisler's plan to build devices specific to niche markets -- consumers in particular -- offers a load of upside because it accomplishes HP's strategy of filling specific voids in the marketplace. One of HP's recent unveilings -- its OMEN desktop and laptop PC -- is an ideal example of how it was able to deliver flat year-over-year revenue in its fiscal third quarter despite global sales declines.

HP's personal systems division's revenue was flat last quarter, and actually increased 2% after factoring in currency. Not bad, considering the overall PC market declined 4.5% in calendar Q2. The saving grace for HP was its 8% jump in consumer net revenue, led by a whopping 12% increase in notebook earnings in fiscal Q3. Those results more than offset the 3% drop in commercial sales.

The OMEN devices are designed for the world's gamers and include top-shelf displays and performance, and a virtual-reality-ready experience. For the fast-growing video-streaming market, HP just unveiled its new Pavilion Wave featuring surround sound and a 4K display, all for $550. The HP Elite Slice, another new offering, "is the first modular commercial desktop with cable-less connectivity and enables customers to build the desktop of their choice."

Printers remain HP's biggest challenge, as evidenced by the company's 14% drop in net revenue last quarter. That said, HP is actively working to bring 3D printing to the masses, not just commercial enterprises. And Weisler's plan to focus on high-end printers to drive ancillary sales and service revenue will also give its struggling unit a boost -- eventually.

Image source: IBM.

The case for IBM

For CEO Ginni Rometty, transforming IBM was -- and remains -- a challenge. IBM has reinvented itself from the ground up, which is no easy task given its size and onetime reliance on "traditional" markets, including enterprise hardware. That said, IBM began its transition a few years ago, and patient shareholders are reaping the rewards.

IBM's new-ish revenue drivers -- Rometty's strategic imperatives -- include data security, cognitive analytics, the Internet of Things, and Software-as-a-Service (SaaS). Most are delivered via the cloud. At an annual run rate of $11.6 billion in sales, IBM is sitting near the top of the cloud provider heap. Better still, IBM's $6.7 billion in cloud SaaS sales the past 12 months positions it to capture the fastest-growing piece of a seemingly limitless opportunity.

One conservative estimate suggests the cloud market will more than double in four years, to over $141 billion, nearly 70% of which will be spent on SaaS solutions. As a group, IBM's strategic imperatives climbed 12% last quarter, generating $8.3 billion in revenue -- equal to 38% of total sales.

Rometty is investing heavily in IBM's new direction, writing over $5 billion in checks for acquisitions already this year and forging alliances with some of the cloud and data analytics sectors biggest players.

So which is the better buy? In addition to both HP's and IBM's success in their respective transitions, both offer ridiculously good value for growth and income investors.

HP is trading at a dirt cheap multiple of just nine times forward earnings, and boasts one of the tech industry's best dividend yields -- 3.5%. IBM is trading at only 11 times future earnings, and also pays a 3.5% dividend. The reason IBM warrants a slight nod over HP as the better buy is the upside its strategic imperative markets offer. But don't feel sorry for HP shareholders. They won't be disappointed either.