1.2 On Open Source
The question of what "open source" really means is in many ways an obscure one. There is no universally recognized body that is empowered to define the term. There is not even global consensus that it is a useful term.
A first reasonable attempt at a definition is as follows: A product is open source if the full source code comes included with the product. To put it another way, a set of classes could be considered open if the .java files are provided along with the .class or .jar files.
This definition implies that, at any time, a working version of the product can be reconstructed by compiling the source files, just as the original provider would have done in preparing the class or jar files. The definitional subtleties arise when considering what else the recipient can do with the source code besides compiling it as-is. Is the recipient allowed to make changes to the source code and compile that? Is the recipient allowed to incorporate the source code into its own products? Is the recipient allowed to give original or modified source code to other people?
Each developer who decides to provide source code with their products is free to answer these questions as they see fit. Typically the answers are codified as a license to which the recipient must agree. Even the point at which the agreement happens is subject to variation. Some licenses must be accepted to use the software; others need only be accepted to redistribute the software.
Open source is more than a label that may or may not apply to a particular piece of software. It is also a way to think about development, a philosophy, and, perhaps, a movement. The definitions get even muddier here; a brief history should help clarify them. Please note that this history is very abbreviated, and each of the participants will likely tell it a little differently. See some of the Further Reading at the end of this chapter for more information.
In the early 1980s a developer at MIT named Richard Stallman was facing an ethical dilemma. He felt that if he liked a program he had a moral obligation to share it with other people who might also like it. This sharing would of necessity include not only the program itself but also the source. He has often compared the situation to a recipe: If someone likes certain cookies, they should be free to give some cookies to others to enjoy. But maybe the original recipe uses walnuts, and a lot of people are allergic to nuts. The recipe can be modified to omit nuts, and in the end a lot more people can enjoy the cookies.
The Unix system and tools he was using at the time did not have this property of being sharable. So he gathered a group of volunteers and started the Free Software Foundation (FSF), whose initial goal was the creation of a complete replacement for Unix, called GNU, that would be distributed in accordance with his ethics and ideology.
At no point was this described as "open source," because the openness of the source was a consequence, not a goal. Instead the term "free" was used, and as is often stressed, this refers to liberty, not price. A user of free software is permitted to do anything at all with that software, except restrict other users from doing the same. This idea was encoded as the GPL, the General Public License, under which all FSF code is released.
By 1991 a great many of the elements that comprise a complete Unix system had been completed. The one major piece still missing was the core of the system, also called the "kernel." The GNU project had been working on a kernel called the HURD, which would incorporate a number of cutting-edge concepts in operating system design. Today the HURD is usable, and it continues to be developed, but it was not nearly ready in 1991.
Around that time a programmer named Linus Torvalds developed his own kernel, which while initially not as cutting edge as the HURD, was stable and complete. Torvalds chose to release this kernel under the terms of the GPL, which enabled it to be used in conjunction with the other elements the GNU project had already developed. The resulting complete system became widely known as Linux, although some, including Stallman, feel that the name GNU/Linux is more appropriate because everything but the kernel originated as part of GNU. [1]
The rise of the GNU/Linux system is nothing less than remarkable, and it is now replacing products from long-established companies like Sun and Microsoft in many places. However, much of its rise can be attributed to pragmatic rather than ideological reasons. Many believe that these reasons are directly attributable to the openness of the source. It is claimed that having the source available makes bug fixes faster and more reliable, makes features easier to add, and makes the whole system easier to customize for particular purposes.
These pragmatic motivations for using and contributing to open source were written up in a document called The Cathedral and the Bazaar by Eric S. Raymond. This document had a huge impact. Suddenly people who would never agree with Richard Stallman's ideals saw other reasons to get involved. The number of open source projects, and licenses, exploded exponentially.
This new interest in open source quickly led to the formation of the Open Source Initiative (OSI), which acts as a grassroots campaign for the support of open source. Among other things OSI has drawn up a statement of what constitutes "open source" and maintains a list of what licenses qualify. The FSF also maintains a list of what licenses qualify as free. While neither of these sources is universally accepted, they are the closest thing to standards bodies that exist.
At this point there are still tensions between the "free software" and "open source" communities, even as they work on projects together. Their differences are worth considering, and every developer who benefits from free or open source software should at least consider them and decide for themselves whichif eitherview they support and will live by.
These issues will not be discussed again in this book, beyond pointing out that all the code in this book is released under licenses that qualify as "open source" according to OSI and "free" according to the FSF. However, not every license is compatible with the GPL, which may be regarded as the definitive free software license. [2]
The benefits of open source software are particularly relevant in the context of tools. The source code of a tool may itself be considered another toolpieces and algorithms may be extracted and used in other contexts, reducing development time. It is also possible, if not always easy, to modify a tool for a particular purpose. It is as if a screwdriver can be adapted to use on an unusual screw instead of having to buy a new screwdriver. There are many examples throughout this book of how these ideas are realized in practice.