Social networking giant Facebook is no stranger to the world of open source. After all, CEO Mark Zuckerberg originally built Facebook on top of open-source infrastructure components. During a keynote at the Linux Foundation Collaboration Summit on Feb. 18, James Pearce (pictured), head of open source at Facebook, detailed how the company’s open-source efforts have been reinvigorated in recent years with an increasing number of projects and code contributions.
“Open has always beaten closed, being connected has always beaten being isolated, and sharing has always trumped secrecy,” Pearce said.
Pearce’s responsibilities at Facebook include 235 projects that have been open-sourced by the company over the years. All those projects amount to more than 10 million lines of code that Facebook has made available as open source. Many of those 235 projects are available on GitHub, where Pearce said Facebook now has more than 150,000 followers and 26,000 forks.
“So these are projects that people are finding valuable and useful,” Pearce said.
The pace of open-source project development at Facebook has accelerated in 2014. In the second half of 2014 alone, Facebook launched 64 new open-source projects, he said.
“What’s interesting is not just the quantity of projects, but the diversity of them,” Pearce said.
Among the projects launched by Facebook in 2014 are data infrastructure, Web infrastructure, mobile tools, developer infrastructure and even the firmware for the Oculus Virtual Reality DK1 headset.
Why Open Source
Contributing code into the open-source community has some very practical and tangible benefits for Facebook.
“We’re an engineering-led organization, and the open-source philosophy fits very well with that,” Pearce said. “We think that it also helps people to think of Facebook in a positive light.”
One area in which the positive light of open source has helped Facebook is in its talent recruitment efforts. Many new engineers who join Facebook cite the open-source efforts as a reason why they want to work at Facebook, according to Pearce. Familiarity with Facebook’s open-source projects also has other benefits for new employees.
“When people join the company and they are using technology that they are already familiar with, since it has been open-source, they are able to become effective more quickly,” he said. “If you have to wait six months for an engineer to get trained on a proprietary internal system, that’s time wasted.”
Open Source Is Better Code
There’s another benefit to open-sourcing code: The whole process of making code available as open source leads to better code overall. Pearce explained that because code will be available as open source for anyone to use means that code is first put under heavy scrutiny.
“We make sure that the APIs are all super clean, we make sure it’s really modular, and we make sure it doesn’t have tendrils stretched throughout other parts of the architecture that it shouldn’t,” he said.
Facebook Picking Up the Pace on Its Open-Source Code Journey
All that effort to make sure the code is solid occurs even before Facebook receives any contributions from the broader open-source community.
Managing Open Source
Pearce said there are a number of metrics he is able to use to measure how Facebook’s open-source projects are doing in the community. Since most of the projects are on GitHub, the number of people watching any given project is one good measure of interest in the project. The average number of forks per project is another metric that Pearce tracks.
Pearce also tracks the ratio of external commits made by non-Facebook engineers to internal Facebook commits—another way to gauge interest and activity.
While Pearce’s job responsibility includes overall management of Facebook’s open-source efforts, he doesn’t actually manage the individual developers.
“There are hundreds of employees that develop open source code at Facebook, and I have no management authority over any of them,” he said.
Pearce has found that gamification works as a motivator for Facebook’s open-source developers. He said he uses all the various open-source project metrics that he has available to play various teams and projects against each other in friendly competition.
Linux
Over the last 18 months, Facebook has also refocused its Linux kernel contribution efforts, according to Pearce. The emphasis at Facebook is on getting its changes contributed back to the upstream Linux kernel community, he added.
Facebook now has what Pearce refers to as a “proper” team with 12 developers on it to look after the company’s Linux kernel contributions.
“The sheer talent of the team has enabled us to reboot our contributions and help improve things,” he said.
Pearce added that Facebook moved from making six code commits to the Linux kernel in 2013 up to 229 code commits in 2014.
“The reason why we haven’t open-sourced an operating system is because you already have one,” Pearce told Linux Foundation Collaboration attendees. “We’re really thrilled to work with you as a community because Linux makes all of this possible.”
Sean Michael Kerner is a senior editor at eWEEK and InternetNews.com. Follow him on Twitter @TechJournalist.