Government best practices

Open source

Why should I use open source software?

There are lots of arguments in favor of adopting an existing open source project over its proprietary counterparts. A few of the biggest ones:

What are the advantages of producing open source software?

In addition to the efficiencies inherent with a collaborative model (independent code review, communal feature development, working across organizations), empirically, open source produces better, more reliable software. Think about it logically. When you (or your organization) is the only person that’s ever going to see something, you’re a lot more likely to “just make it work.” After all, who would ever know?

But the same logic that applies to sweeping literal dirt under the rug doesn’t apply to writing code. Whereas a rug will always serve to cover the floor, applications evolve over time and code is often constantly reused and repurposed as customers’ needs change. Simply put, it’s impossible to predict today where your code is going to be a year from now and it’s in your best interest to plan accordingly.

Open source hedges this risk by distinguishing generic logic (say posting content online) from application-specific customization (say the use-case-specific presentation of that content). Yet when you’re writing with the intention of producing proprietary or one-off code, you do everything in one pass. The true challenge arises when the same problem emerges again in another department, another business unit, or more generally in an even slightly different context. You’re reinventing the wheel. You’re “open sourcing” (even if within your organization).

Imagine you building a house and the contractor literally nails down all your furniture at the onset, saying you could always remove it before you sell. You’d almost certainly hire a new contractor. Even if you’re never going to sell the house, you may want to get a new couch, or at the very least change a room’s layout somewhere down the line. Yet software developers do it all the time.

Distinguishing unrelated components encourages several coding best practices. In addition to introducing a modular design, meaning additional components could easily be added (or existing components removed) down the line, abstraction often yields objectively more stable and more readably maintainable code due to the abhorrence of the copy-and-paste effect. Justice Brandeis is famous for noting that “sunlight is the best disinfectant.” Likewise, the transparency afforded by the open-source ethos produces more reliable software.

Why should I release my (agency’s) software as open source?

Why not? Think about why we have proprietary software. Google doesn’t share the code powering its search algorithm for fear that a competitor could benefit. That’s their secret sauce. It’d be like Coca Cola sharing its secret formula. But outside certain military contexts, with public code, there’s no competitor. In fact, quite the opposite’s the case. If agency X writes a better way to store and publish content, and agency Y adopts it, that’s a good thing for both the agencies and for the American people. It creates an efficiency across government that would not otherwise exist. Put another way, we’re all on the same team here.

But open source isn’t just sharing code among agencies. Imagine if agency X’s content organizing code is posted online and a non-profit uses it to launch a new initiative, or a startup uses it to launch a new venture. Again, the agency is not in competition with the innovation and we all benefit.

Last, in that same example, let’s say as that startup is adopting Agency X’s code for their own use, they discover a bug, or a great new feature and contribute it back. Agency X, Agency Y, a startup and a non-profit are now all better off than if Agency X had not released the code.

More broadly, publicly funded code, is well, the public’s code. It’d be like building a highway, but saying only firetrucks and police cars can use it, even though that’s only a fraction of its potential. We see this most analogously with research grants in the scientific, academic, and medical communities, and the requirement to publish scholarly works and research findings that result from public funding.

What agencies participate in open source?

A lot. See the full list of who’s using GitHub.

When in the project life cycle should I make my code public?

The expectation is that those that produce the software would release the underlying code early and often in its raw form. Bugs and unpolished work are not only accepted, it’s the norm.

Think about it this way: putting out a press release with a typo (or even an unfinished press release) is embarrassing because the point of the network is to disseminate information from agency to press and erroneous or missing content hinder that end. The point of open source on the other hand is to collaborate in the creation of software. Allowing early adopters to discover bugs, review early project road maps, and suggest ways to improve the software furthers that end. As a result, openness, transparency and contributions and valued much more highly than refined code and polished documentation.

Put simply, the culture on this social network is not to criticize but to create.

Additional Resources