What open source is

Open-source software comes with its source code and a license that lets anyone read it, use it, change it and share it. Linux, Python, Git, gcc, Firefox and VS Code are all open source, and so is StepVioz. Most of the software you use every day stands on open-source code.

Why contribute?

  • You learn from real code, far bigger than any class project.
  • Experienced programmers review your work, for free.
  • Your contributions are public: employers can see them.
  • You give something back to the tools you use.

Code is only one way to help. Projects also need bug reports, clearer documentation, tests, answers to other users' questions, and reviews.

Licenses

The license says what others may do with the code. Without one, the code is "all rights reserved": you may read it, but not legally copy or change it.

LicenseIn short
MIT, BSDdo almost anything, but keep the copyright notice
Apache 2.0like MIT, plus rules about patents
GPLif you share a changed version, you must share its source under the GPL too
CC BY-SAfor text and pictures: credit the authors and share changes under the same license

StepVioz's code is under MIT, and its lessons under CC BY-SA 4.0.

What a project looks like

files = ["README.md", "LICENSE", "setup.py", "src/app.py", "tests/test_app.py"]
expected = ["README.md", "LICENSE", "CONTRIBUTING.md", "CODE_OF_CONDUCT.md"]

missing = []
for name in expected:
    if name in files:
        print("found:  ", name)
    else:
        print("missing:", name)
        missing.append(name)

print(len(missing), "file(s) to add")
Open in compiler

Most projects have the same few files at the top. This program checks a list of files for them:

  • README.md: what the project is, and how to install and run it. Always read it first.
  • LICENSE: the license.
  • CONTRIBUTING.md: how to contribute: how to set up, run the tests and send a change.
  • CODE_OF_CONDUCT.md: how people are expected to treat each other.

On GitHub or GitLab, a project also has an issue tracker (bug reports and ideas) and pull requests (changes waiting to be added). The people who decide what goes in are the maintainers; everyone who sends changes is a contributor.

Quick check

1. A project on GitHub has no LICENSE file. May you copy its code into your project?
2. Which license requires you to share the source of a changed version you distribute?
3. Which file do you read first in a new project?
My notes

Write down what you want to remember from this lesson. Notes are saved on this device as you type, and appear on your dashboard.