Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How/where to start reading open source code? [closed]

Tags:

open-source

I have always wanted to participate in an Open Source project but once I got the source code, I don't know where to start.

Sinatra framework (Ruby-based) and Apache Maven 3 are in mind but I don't know where to start.

How usually starting reading/viewing open source code?

Thanks for help and time.

like image 912
Chiron Avatar asked Jul 23 '10 13:07

Chiron


People also ask

How do you read large open source projects?

Begin with a very simple idea relevant to the project you are going to contribute to. Then, turn that idea into reality primarily using that open-source project. Throughout the process make sure to learn about the project's dependencies, features, and important components/classes.

What is important to get right when you are working on open source projects?

A successful open source project requires a lot of time and commitment. First of all the project must solve a problem, and solve it good. Developers are searching for good solutions for their problems. You must invest about 50% of the time into creating quality README.md and detailed documentation.


2 Answers

As you start to read more source code, you'll get better at this; you'll find what works for you.

In the meantime, there are a few strategies:

  1. Pick a feature you like, and try to find the source that implements it
  2. Find the beginning point in the source and step through it, try to understand how it sets itself up
  3. Start poking around aimlessly until you find something that makes you curious (i.e. that's an interesting technique, why have they done that? etc)

One thing that helps me is to put myself in the author's shoes. Why did they do things this way? Was it good/bad? For me, reading source code is about learning new strategies for solving problems. I usually look at a project and think how I would have done it, then I see how they do it and compare.

Specifically for Sinatra, if it were me, I'd setup the most basic Sinatra web app, and then try to figure out how the "get" method sets up a listener. Trace it back to it's Rack roots (Rack is the webserver it uses). You might end up learning a little bit about Rack applications.

You don't have to understand everything you see, but like in the above example, you'll want to get some kind of bearing of what's going on. Then ask more questions and try to find the answers.

like image 108
Jon Smock Avatar answered Sep 21 '22 07:09

Jon Smock


  1. Pick a project you like to use.
  2. Look up the bug tracker.
  3. See if you can find the code related to a bug that looks interesting.

You don't necessarily have to be out to fix the bug; just find out how the piece of the project involving the bug is done and what code makes it go. If you happen to spot the issue with the code, maybe you can fix it, and then you'll have stepped into being an actual contributor as well, in which case congratulations are in order. If not, you still start to get a feel for how the project is put together.

like image 39
Walter Mundt Avatar answered Sep 18 '22 07:09

Walter Mundt