If you've ever wanted to contribute to open source projects but don't know where to begin, here are some tips to get you started.
Good understanding of one programming language of your choice
Understanding a programming language is not just knowing the syntax or how recursion works. If you already know that, great! You are past the first hurdle. Next, you need to take up the task of learning the multiple major libraries and packages that are going to be used in any medium to large-scale projects. Look up the relevant libraries of your programming language and devote time to learning them. A good understanding of these will go a long way in helping you understand any code base better.
Version Control System
Yes, this is where Github comes in. Distributed revision control (DVCS) is one way to do collaborative coding which makes sure that all the code remains secure and concurrent at any given point in time. All, and I mean ALL organizations use some form of version control. Major ones are SVN and Git. Although now, mostly every organization have switched to Git for some of its features while some might still be using SVN. Github is just a Git client which lets you host your code online. Learning Github is not the same as learning Git. Therefore, learn Git first — book, then move on and learn how to use Github. For quick reference, you can also use this: Try Git—having familiarity with version controls will give you quite an edge over other candidates.
Learn to read the source code
There is no substitute for the ability to read through seemingly gigantic code bases. Let’s face it, most of the documentation for any code can be confusing for anyone. It may be useful for the end user but for any new developer, it may appear gibberish. You are on your own when you need to go through the source code of something which spans hundreds of thousands of lines with hundreds of files.
Where does one start? Well, it depends. Learn how to use bug or issue trackers which most likely, every organization will have. If you don’t know what a software bug is, now will be a good time to start. Bug trackers are like the version control systems which we talked about earlier. In fact, most version control clients will have an implementation of the bug tracker themselves. Github has an “Issues” system, which is the same thing. A bug tracker, basically, lists all the “issues” (or bugs) currently identified with the software and their “status” (Are they solved? Unsolved? Being worked on?). Bug trackers provide the non-developer end-users with a way to point out a problem in the software. They might also be used to request a new feature, which is different from a bug.
Once you’ve learned all of the above (and trust me, it is not much), you are ready to submit some patches or bug fixes to a project of your choice. Choose any open-source project — preferably written in a language you know, and more importantly, interests you — and go and browse through its bug tracker. Most bug trackers have issues marked as volunteer or introductory. Search for such issues, or go with any issue which you think you can fix. Comment or write an update on the issue saying you are taking it up. Solve it on your local system (you’ll know what this is once you know how to use version control) and then push it to the organization’s remote code base. This is easier said than done (let’s be honest). You’ll need to know the following, at the very least:
- What DVCS the project is using.
- What are their workflows for code contribution? (Most organizations have a defined way to submit a patch and you MUST follow that).
- How to get involved with the community. Because even open source projects won’t accept unauthorized/unreliable code from some newcomer. More on this on the next point.
Select an organization or project and contribute
This can come either after or before the last point. If you have no idea which organization interests you, go to the Google Summer of Code 2016 and browse through the list of accepted organizations. Most organizations get accepted recurringly, so you are safe in picking an org which has been accepted 2–3 times already. Make sure to filter according to the language of your choice. Once you’ve picked an organization, start creating a good reputation for yourself. To do this,
Get in contact with the developers. Use IRC, subscribe to the developer mailing list of that org.
Submit patches. Nothing will help your case as much as your coding capabilities. Fix bugs. Even just one is good. Start with the easiest of bugs. If in doubt, ask the devs to direct you to the bug they think will be good for you to start with.
Get familiar with their workflow. This includes, how they contribute code, their coding style, if they hold any online meetings (do attend), etc.
Ask Smart Questions
Once you are up and running in contributing to a project, you WILL face difficulties. You might not know how a particular piece of code is working, or you might not know about the required technology. This is the time for you to ASK. Ask the established developers in that project, or anyone whom you think might know the answer in general. Asking is not a sign of weakness but it will, instead, help see you through a lot of unnecessary struggles. But at the same time, remember How To Ask Questions The Smart Way.