IT WAS one of Silicon Valley’s most riveting success stories. Now it stands as a warning to others. Yahoo began in 1994 as a lark in Stanford’s dormitories, when two students, David Filo and Jerry Yang, assembled their favourite links on a page called “Jerry and David’s Guide to the World Wide Web”. The site, which they renamed Yahoo, quickly became the “portal” through which millions first encountered the internet. At its peak in 2000, Yahoo had a market value of $128 billion. In the dotcom version of Monopoly, Yahoo got the prime slot.

This week its history as an independent firm came to an end. On July 25th Verizon, a telecoms giant, announced that it would pay around $4.8 billion to acquire Yahoo’s core business (see article). The sale will come as a blessed relief to shareholders. Yahoo churned through four chief executives in the three years before the hiring of Marissa Mayer in 2012. Her efforts to turn the company round may have failed, but the seeds of this week’s sale were sown long before she arrived. Three problems explain the firm’s demise.

The first was a chronic lack of focus. Right from the start Yahoo was ambivalent about whether it should be a media or a technology company. As a result, whenever the internet zigged, Yahoo zagged. It could not decide whether search was a “commodity” business to be outsourced or an area worthy of heavy investment; its prevarication allowed Google to rise. It took too long to respond to the emergence of social media and the coming of the mobile internet. Ms Mayer, and the company’s toothless board, did nothing to resolve Yahoo’s split corporate personality.

Instead of focusing, Yahoo sprawled. By 2001 it had 400 different products and services. Its cumbersome structure proved no match for specialised rivals such as Google in search and eBay in e-commerce. Yahoo was notoriously dysfunctional: at one point it had four different classified-advertising businesses, each using different technology. This contains a warning for others. Silicon Valley is known for its world-changing ambitions, but managers can be distracted by doing too many things at once. Alphabet, Google’s parent company, which continues to push into new areas, should take note.

A second problem at Yahoo concerned dealmaking. Some of its purchases paid off: by the end, its stake in another web giant—Alibaba, a Chinese e-commerce firm—was worth far more than its own internet properties. Others flopped: Ms Mayer, for example, bought Tumblr, a social-networking platform, for $1.1 billion in 2013, even though it was about to run out of money. But a company’s success depends as much on the deals it does not do as on the ones it does. Yahoo’s history is littered with transactions that should not have been passed up. It did not buy Google for $1m when it had the chance. It agreed to buy Facebook for $1 billion, but the deal fell through when Yahoo tried to negotiate down the price. It eschewed the chance to buy YouTube (subsequently bought by Google), and its purchase of eBay fell through because of clashing egos.

The long shadow of Steve Jobs

Most galling of all, Mr Yang, the chief executive at the time, had the chance to sell Yahoo to Microsoft for around $45 billion in early 2008. His pride and his desire to head his company led him to reject the offer. This is the third lesson from Yahoo’s demise: founders can often be too attached to their progeny to make the right strategic decisions. Silicon Valley still believes in the idea of founders as visionary turnaround artists. Last year Jack Dorsey was brought back to run Twitter, a social-media firm (while continuing to run Square, a payments company that he also founded). Shareholders of both firms should consider Yahoo’s example carefully. For every Steve Jobs, who successfully resurrected Apple, there is a Mr Yang.