When someone buys a new smartphone, often they're preoccupied with the camera specs or the size of the screen or its storage capabilities. It's easy to overlook one of the most foundational aspects of these sleek consumer gadgets: their operating systems. The world's most popular mobile operating system is Google's Android. It powers more than 86 percent of smartphones in the world. What's even more remarkable is that Android is based on the open source Linux operating system.

That means anyone can view the code at the heart of the vast majority of smartphones, modify it, and, more important, share it with anyone else. This openness enables collaboration. Unlike, say, Microsoft Windows, which was developed and is maintained by a single company, Linux is developed and maintained by more than 15,000 programmers around the world. These programmers might work for companies that compete with each other, or they might volunteer to create something new that’s then given away. For free. Gratis.

As crazy as that might sound, the open source way of building software is now embraced by the likes of IBM, which plans to pay $34 billion for open source company Red Hat, Microsoft, which paid $7.5 billion to acquire the code hosting and collaboration platform GitHub, and Walmart, which released its own open source software.

Open source is even seeing applications in the next iteration of technology: AI. Google open sourced its artificial intelligence engine, TensorFlow, in 2015, enabling companies and researchers to build applications using some of the same software the search giant used to create tools that search photos, recognize spoken words, and translate languages. Since then, Dropbox has used TensorFlow to recognize text in scanned documents and photographs, Airbnb has used it to help categorize photos in its listings, and a company called Connecterra has used it to help dairy farmers analyze their cows' health.

Why would Google give away something so central to its business? Because it hoped outside developers would make the software better as they adapted it to their own needs. And they have: Google says more than 1,300 outsiders have worked on TensorFlow. By making it open source, Google helped TensorFlow become one of the standard frameworks for developing AI applications, which could bolster its cloud-hosted AI services. In addition to garnering outside help for a project, open source can provide valuable marketing, helping companies attract and retain technical talent.

Keep in mind that Google didn't give away the data that powers its AI applications. Just using TensorFlow won't magically allow you to build a search engine and advertising business that can compete with Google.

So Google stands to benefit, but why would an outsider contribute improvements to TensorFlow? Let's say a company makes its own version of TensorFlow with unique elements, but keeps those elements private. Over time, as Google made its own changes to TensorFlow, it might become harder for that other company to integrate its changes with the official version; also, the second company would miss out on improvements contributed by others.

In short, open source provides a way for companies to collaborate on technology that’s mutually beneficial.

The Rise of Open Source

The open source software movement grew out of the related, but separate, "free software" movement. In 1983, Richard Stallman, at the time a programmer at the MIT Artificial Intelligence Laboratory, said he would create a free alternative to the Unix operating system, then owned by AT&T; Stallman dubbed his alternative GNU, a recursive acronym for "GNU's Not Unix."

For Stallman, the idea of "free" software was about more than giving software away. It was about ensuring that users were free to use software as they saw fit, free to study its source code, free to modify it for their own purposes, and free to share it with others. Stallman released his code under a license known as the GNU Public License, or GPL, which guarantees users those four software freedoms. The GPL is a "viral" license, meaning that anyone who creates software based on code licensed under the GPL must also release that derivative code under a GPL license.

Importantly, the license doesn't forbid companies from selling copies of GNU software. As long as you allow your customers to share your code, you can charge as much as you want for your software. The phrase "free as in free speech, not free as in free beer" is often used to help explain this apparent contradiction.

Other programmers soon followed Stallman's example. One of the most important was Linus Torvalds, the vitriolic Finnish programmer who created the Linux operating system in 1991. Linux is a "kernel," the core of an operating system that talks to the hardware and translates the basic input from your keyboard, mouse, or touchscreen into something the software can understand. GNU lacked a finished kernel at the time, so many GNU users combined GNU and Linux into a functional operating system. Bundles of the GNU operating system, Linux kernel, and other tools became known as GNU/Linux distributions; some purists still refer to Linux-based operating systems as "GNU/Linux." Soon, companies like Red Hat were making money selling support for open source technologies like Linux.

Linux—or GNU/Linux if you prefer—became especially popular for running web servers and now runs 69.4 percent of web servers, according to data compiled by W3Techs. Alongside the rise of Linux and the web came several other free tools, including the Apache web server, MySQL database, and programming languages like Perl and PHP. Many used the GPL license, but others adopted more permissive licenses that, unlike the GPL, allowed companies to create proprietary products using their code.

In time, tensions grew between those, like Stallman, who believed that all software should be free on ethical grounds, and more business-oriented developers who thought that freely sharing code was a better way to build software but not an ethical imperative. In 1998, a group met to discuss how to promote the idea of shared code and open collaboration. Worried that the term “free software” and Stallman’s more absolutist philosophy would make their ideas less palatable to businesses that wanted to keep some of their code proprietary, the group settled on the label "open source," coined by Christine Peterson, to distinguish its aims.

During the 2000s, open source went truly mainstream. In 2004, programmer David Heinemeier Hansson released his web application programming framework Ruby on Rails, which quickly became one of the world’s most important web development tools, as well as the foundation for services like Twitter and Kickstarter. Meanwhile, Yahoo was funding the development of the open source data-crunching system Hadoop. After its release in 2006, other companies, including Facebook, Twitter, and eBay began contributing to the project, helping demonstrate the value of inter-company collaboration. Sun Microsystems' $1 billion acquisition of MySQL in 2008 proved open source could be big business. That same year Google released its first Android phones, moving open source from the server to your pocket.

Now open source is practically everywhere. Walmart uses open source software like the development platform Node, and it has opened up the code of its cloud management tool OneOps and its development platform Electrode. JP Morgan Chase open sourced its blockchain platform Quorum, on which its employees collaborated with the creators of the privacy focused bitcoin alternative Zcash. Even Microsoft, whose former CEO once called Linux a "cancer," now uses and releases open source software such as its popular .NET programming framework. It even uses Linux to run parts of its cloud service Azure and has shared its own Linux tools with the community.

Open source isn’t counterculture anymore. It’s the establishment.

The Future of Open Source

The rise of open source hasn't been without glitches. Despite the corporate world's embrace of open source software, many independent or startup-based projects still haven't figured out how to make money. Even the developers of software that’s widely used by major companies can struggle to raise funds to cover their costs or hire others. That can have serious consequences.

For example, in 2014, security researchers revealed serious vulnerabilities in two crucial open source projects: OpenSSL and Bash, which are part of many major operating systems. No software is free of potential security problems, but the fact that these issues went undetected for so long highlighted a big problem for open source: Many big-name open source projects rely on lesser-known open source components run by volunteers who have little time to fix problems and no money to hire security auditors.

Some companies that have built businesses around open source products are adopting controversial new licensing schemes. In an effort to keep cloud computing services from selling competing services based on its code, MongoDB created a new license in 2018 that restricts how other companies can use its MongoDB Community Server. Other open source companies have adopted the Fair Source license, which requires companies with more than 15 employees to pay a fee to use software that uses the license, or the newer Commons Clause, which restricts how companies can commercialize the software. You can still view the source code from software released under these licenses, but they break with the free and open source software tradition of allowing users to do whatever they want with the code.

Startups, meanwhile, are working on novel ways to turn a profit on open source. Red Hat makes money by selling support for its open source products, but that’s not feasible for every open source project. A company called Tidelift aims to sell support through a single subscription fee for a package of open source projects. Think of it as “Netflix for open source.”

Solving these funding problems is crucial to the future of open source. But money isn’t the only problem. The open source workforce is even less diverse than the tech industry as a whole, according to a survey conducted in 2017 by GitHub. Half of the respondents had witnessed bad behavior—such as rudeness, name calling, or harassment—and said it was enough to keep them away from a particular project or community. Around 18 percent of survey respondents had experienced such bad behavior firsthand. That's a problem because working on open source projects is now an important part of landing a job in technology. If women and minorities are shut out of open source, then the technology industry as a whole becomes that much less diverse.

One way many open source projects are trying to address the issue is through a code of conduct called the Contributor Covenant, which warns participants against personal attacks, harassment, or "other conduct which could reasonably be considered inappropriate in a professional setting." As common sense as these guidelines might sound, they've proved controversial among open source coders used to being judged solely on their code, not their professionalism—or lack thereof. The author of the Contributor Covenant is still periodically harassed.

Still, there are signs of progress. In 2018, Torvalds, long accused of creating a toxic environment in the Linux community, apologized for his past behavior, and the Linux project adopted the Contributor Covenant.

Inclusion isn’t just an ethical issue for open source. Diverse teams build better products. And making better software is what open source is all about.

Learn More

Last updated April 23, 2019.

Enjoyed this deep dive? Check out more WIRED Guides.

Read more: https://www.wired.com/story/wired-guide-open-source-software/