How To Make Code Open Source

Open-source code is designed to be shared by everyone. This means that you can view the underlying code of a program, use it as you wish, and modify it to suit your needs. In this article, we’ll talk about how to make your own code open source.

Many developers would like to contribute to open source projects, but don’t know where to start. This article provides an introduction to open source, the basic requirements of an effective contribution, and covers some common pitfalls new contributors encounter in their very first efforts.

Get to know GitHub

GitHub is the most popular platform for open source collaboration, so you’ll probably use it when exploring the world of OSS. First, you need to create a GitHub account and read the guide that helps you get started. On GitHub, you can contribute to projects by submitting issues and contributing code. Submitting issues means sending messages about errors in applications and suggesting ways to fix them. Contributing code involves sending pull requests with your corrections and improvements.

Prep the Code

The baseline requirement for a project to be viable in the open source landscape comes down to the thing that makes open source a concept in the first place: enabling other people to be productive using, modifying, and improving its code. With that obvious requirement, you need to ask yourself a simple question:

If I handed someone this project right now, how hard would it be for them to read the code, run the code, and change the code?

You could follow up on that with:

  • Are there any tools that the contributor should install or be familiar with before getting started?
  • Does it matter what platform the person is working on (Windows vs Mac vs Linux)?
  • How can the person be confident that making a change in one place won’t break something else in the code, i.e are there any tests?
  • Is the code well organized and easy to follow?

All of these points are really to say that if you’re going to be putting something out there with the intention of others picking it up and working on it, you should take the necessary steps to set them up with a quality product. There are many books out there that outline some of the best practices for writing good code (Clean Code comes to mind). You might consider handing off your project to someone with technical knowledge but who’s not familiar with it and get their feedback for how easy some basic development task was to complete.

Learn the basics

When working with GitHub, you should know how to use Git – one of the most popular version control tools (also known as revision control tools). Because developers constantly make changes to their code, they need a system that can manage those changes in a central repository. In this way, everyone involved in the development process can download a given piece of software, make changes, and submit updates.

 README

The README might be the most important document included with a project when it comes to providing a newcomer with the summary of what your project is all about. In addition to a brief summary of what the the code is trying to accomplish, the README is the first place you can answer some of the questions listed above. Someone stumbling on your code should be able to start by going through the README and end by at least being able to understand what the code can do, download it to their machine, and run it.

Try to find some examples of cool README documents from some of the prominent open source projects on Github. As flashy as they are with badges and logos, remember that they all answer the basic questions listed above in some way.

Join the community

You can easily join an open source project by subscribing to the mailing list for that project. You can find mailing lists on official websites or on GitHub pages. After being accepted to the list, you can communicate with team members and get support if necessary. Thanks to the vibrant communities present in nearly every OSS project, you are likely to get quick replies to your questions.

The License

The open source license is probably the second most important document you want to include in your project before releasing it out into the wild. In short, since you’re putting your code out there for anyone to see, you probably want to have some control over what people can and can’t do with it once they have it. For example:

  • Are you OK with someone using it to run their business?
  • Are you OK with someone modifying it and selling it as their own, new product?
  • Does the entity using your code need to explicitly give your credit when using any original or modified version of your code?

The good news is, so much of the heavy legal work has already been done by other smart folks on the internet. Github does an amazing job with their helpful documentation as well as reminders when you create a public repo without a license to make sure you include the right one for your needs.

All skills are welcomed

Even non-programmers can contribute to open source projects! Documentation is needed for all projects, and sometimes this is poorly written and maintained. Thus, you can help by writing, updating or even translating documentation. Also, your design skills might come in handy: every application needs an interface, after all. Finally, you can contribute by managing a community by replying to questions and guiding newcomers.

Consistency

Making sure your open source project is successful and productive depends, just like any other project, on you giving it the appropriate amount of time it needs to succeed. This could include simple actions like regularly updating dependencies on major releases, or going through all the open Issues and Pull Requests at least once a week. It’s always better to have someone come across your repo and see commits and merged PR’s that are a few days old rather than a few weeks or months old.

For larger projects with many users and contributors, it might mean making sure you’re being responsive to emails or messages. A common practice among larger open source projects is to have a public instant messaging platform like Slack available for anyone with questions or suggestions to join the community discussion about the project.

Create open source alternatives to commercial software

Today’s commercial projects actively engage open source solutions. Many companies base their projects on free tools. When there’s a huge selection of software, you don’t need to reinvent the wheel. This is why it’s useful to play around with free software that can replace similar proprietary software, or that fixes an issue you’ve recently faced.

Another reason for replacing commercial solutions with open source software is eagerness for real innovation and growth. Commercial software claims to be innovative, but its final goal is turning a profit. Open source software unites best practices, great quality of code and passionate developers willing to code just because they like to.

How to Contribute

A set of contributing guidelines is the next important piece of documentation you should include, usually in the form of a CONTRIBUTING document much like the README. The CONTRIBUTING document or set of documents serve to inform the prospective newcomer to your code on how you as a maintainer want them to go about making contributions.

A CONTRIBUTING doc serves to answers some questions like:

  • What are some ways I can contribute in the first place? Are you, the maintainer, just looking for bug fixes or new features?
  • What’s the first thing I should so when I want to make a change to this code?
  • Should I create an issue or just fork and pull request?
  • Are there any branching conventions I should follow?
  • Should I write my commit messages in a certain way?
  • Who are the maintainers aka. who’s in charge here?
  • Do you follow any coding styleguides?

Contribute to existing open source projects

You can find many projects you are free to participate in on GitHub – a developer-oriented platform with a simple but essential set of functionality. GitHub attracts developers with public APIs, a sleek and frequently updated UI, gists (Git repositories) that allow you to share pieces of code or even whole applications, and much more. You can contribute to free software in many ways. Developers can fork projects, make changes to code, and send pull requests. And quality assurance is always appreciated. Sometimes developers are too busy or too lazy to check the quality of their code. So go ahead and report a bug or try to fix it – your help is appreciated.

You can reach the hottest GitHub projects by following the “Trending” link. And in order to make your search more relevant, use advanced search: select the language you would like to code in and choose “best match” criteria. Best match ranks projects according to relevance, taking into account the number of forks (which represents how actively the project is updated) and stars (“likes”, in the language of Facebook). Most projects have known issues (however, some don’t) with labels like “bug”, “discussion”, “security”, or “refactor”, or other labels according to the level of difficulty: “easy”, “medium”, “hard.”

Conclusion

Open source code is a great resource for developers. This book describes how to contribute open source code and what qualities to look for in an open source project.

0 Comments

No Comment.