Elon Musk just made some of Twitter's code open source — here's what that means

In early March 2023, Twitter CEO Elon Musk announced that he would be making some of Twitter's source code — the actual programming that runs the social media service — 'open source.' Why though?
John Loeffler
Elon Musk is open sourcing Twitter code hoping someone will fix his mistakes
Elon Musk has made a mess of things

1 2  

Ever since Elon Musk took the helm of Twitter in late 2022, his decisions have been the source of admiration, derision, controversy, and — in many tech boardrooms at least — no small amount of envy. So it might have struck a number of observers as strange when Musk announced in early March that he would be making key portions of Twitter's source code public.

Even for open-source programming fans, the decision to make the proprietary programming that runs Twitter's major services open to public scrutiny, and even duplication, can only be described as bold. But what does it mean for Twitter source code to become open-source, and what could possibly motivate Musk to do it?

Musk's decision to make portions of Twitter's programming public

Elon Musk has been talking about making Twitter's source code publicly available for a few weeks now. In February, in response to a Twitter user asking that the source code be made public, Musk said: "Prepare to be disappointed at first when our algorithm is made open source next week, but it will improve rapidly!"

That was on February 21, so naturally many Musk fans were impatient when weeks passed without Twitter's source code being opened up. On March 17, Musk responded to the complaints by promising that the source code Twitter uses to Recommend tweets to users in the For You feed would be open-sourced on March 31.

The recommendation algorithm for a social media network is a major component of its business, in most cases, it's a huge driver of its utility for users, so a lot of time, money, and developer effort are dedicated to its creation and maintenance, so opening that up for anyone to poke around in is a major step that most large tech companies wouldn't dream of taking.

Whether Musk will open source all of Twitter remains to be seen, but true to his word, Twitter published two repositories, named "the-algorithm" and "the-algorithm-ml" on the popular online code base GitHub containing large portions of Twitter's source code.

What does it mean for Twitter source code to be made open source?

Elon Musk just made some of Twitter's code open source — here's what that means
A UML diagram of Twitter's recommendation algorithm

Typically, companies that invest money into developing software like to keep their work private for business and intellectual property reasons. They did make these investments after all, so they'd naturally want to make sure that they are the primary financial beneficiaries of that work.

But tech companies, especially Silicon Valley firms, have a deep-rooted culture of cross-pollinating ideas and people between companies and projects, believing that openness gives more eyes on a project, more opportunities for innovation, and a positive, forward-looking belief in the benefits of open source software for society at large.

In fact, some of the most important software in the world is open-source, like the Linux operating system, the Mozilla Firefox browser, and the Git version control system that is essential to software development the world over.

So opening up Twitter to be a more open-source project like those projects rather than the closed, proprietary nature of the Google Search Algorithm or Meta's Facebook recommendation algorithm is definitely something that makes sense in the context of Silicon Valley culture.

That might not be all there is to it though.

Twitter is a massive software project full of spaghetti code, and Musk fired a lot of software engineers responsible for maintaining it

While Musk might argue that the software engineers that were laid off from Twitter, about half of the company's pre-Musk workforce, weren't that essential or weren't committed enough to the vision of Musk's Twitter 2.0, there's no question that the move was also done to cut labor cost in order to make the company profitable.

The problem is that the ad hoc and the rapid, move-fast-and-break-stuff manner in which it was done almost certainly means that a lot of people who knew how to keep Twitter running were unceremoniously let go.

Elon Musk might have thought that some developer's work wasn't good enough or that they weren't committed enough to the company to stay on staff, but if that developer was one of the few who understood how a key component of Twitter actually worked, letting that developer go is a catastrophic mistake.

That kind of institutional knowledge invested in individual employees is an unavoidable consequence of software development, and Twitter is built from millions of lines of interconnected code, so letting go of half the staff means that a lot of developers who were essential to the functioning of Twitter are now gone, and they took their knowledge of how their small slice of Twitter operates with them.

Anyone with any software development experience was shouting this from the rooftops when Musk announced the initial rounds of layoffs and have been shaking their heads as Musk has doubled down on staff reduction and overworking those who remain to make up for the loss of all of that knowledge.

Musk continues to complain about how Twitter's code base is a "mess" that will eventually require a complete rewrite, but it's actually not. It's like every other software project of its size, and Musk, in his efforts to drastically cut costs with a scorched-earth, "hardcore" management style has essentially made it impossible for him and his remaining employees to ever figure out how Twitter works in totality, so there is no way that they will be able to successfully maintain it without constantly breaking it in the process.

Whenever photos stop loading in your timeline or some API service breaks and everyone starts getting mystery errors, inevitably Musk will come out and explain that they made a change to an unrelated system without realizing that it would have consequences throughout the entire system. This problem is only going to get worse, and Musk can't even bring back the devs he laid off because they no longer know the code base as it now stands, so their knowledge is stale at best and entirely outdated at this point.

So what is Musk to do with his $44 billion dollar experiment in chaos management?

Open-sourcing Twitter is Musk's only hope to fix what he broke

Elon Musk just made some of Twitter's code open source — here's what that means
Elon Musk has made a mess of things

What do you do when you fire half your workforce only to realize you actually needed those people and can't get them back? If you can't hire a whole new workforce to replace them (he can't afford all those devs at this point), the only thing you can do is ask for volunteers to come in and do that work instead.

The open-source community is very good at working on diffuse projects in a piecemeal, but collective, fashion, and for working with code written by tens, if not hundreds of thousands of independent developers doing their own thing. With a hundred thousand or even a million software developers looking over Twitter's source code, Musk is banking on the hope that those open-source developers can see what he and the remaining Twitter developers cannot. And he's not off-base here. This is something that a million minds working together could possibly resolve.

Will it work? There's no way to know, but it's highly unlikely. Nothing like this has ever been tried as far as I'm aware, at least not at this scale with a live service project like Twitter. What's more, open-source projects do require an organizing committee to set code standards, plan development priorities, and review code that open-source developers contribute among any number of tasks.

That is an enormous job and I cannot imagine a universe where Musk can manage the transition from a major social media live service used by hundreds of millions of users a day to a well-coordinated, decentralized, open-source project on this scale in time to make Twitter profitable enough to pay the debt financing payments he used to purchase the company that are soon to come due.

And that's while he's actively involved in SpaceX and Tesla. Ultimately, there's not much else Musk can do than what he's already doing, but the dream of a successful open-source Twitter 2.0 is going to require untangling the world's most intricate digital Gordian Knot of code that's ever been attempted.