How did I become an open source contributor? I did a few small projects for language learners and released them under a CC license in a my previous life, but that's not what this piece is about. This is about contributing to an open source project that matters and doing so in a technical capacity.

Step 1: Inspiration

At Hack Reactor Marcus often invites guest speakers to come over and teach us in the evenings. On one occasion it was Jeff Dickey, a senior engineer who had hired a lot of junior devs while working at TapJoy. His talk was fantastic, covering topics from how interviewing to positioning to helping create a better on-boarding environment after being hired. One thing he told us that made an impression on me was just how much hiring managers cared about github profiles. Having just come back from east Asia, this was something I'd only recently fully realized. He showed us his first contribution to a high profile -- a simple CSS fix that any of us could have done!

Obviously, he couldn't claim to be a large contributor off the basis of this one simple fix, but he did get a considerable boost from having it on his profile. If nothing else it was clear that he was engaged and working with the code.

Step 2: Mentoring a new student

A few weeks later, I was pairing with a newer student at Hack Reactor, going over his reimplementation of Underscore.js. He had already completed a CS major before coming to SF, so his code was a bit better than mine had been that early in the course. But I did see one pretty big error-- his implementation of reduce set its memo to zero if the argument weren't provided instead of starting on the first two elements. Here is how his implementation of _.reduce behaved:

_.reduce([1,2,3,4,5], function(a,b) { return a+b;}, 0)
// correctly returns 15
_.reduce([1,2,3,4,5], function(a,b) { return a+b;})
// still correctly returns 15

_.reduce([1,2,3,4,5], function(a,b) { return a*b;}, 1)
// correctly returns 120 (i.e. 1*2*3*4*5)
_.reduce([1,2,3,4,5], function(a,b) { return a*b;})
// should return 120, but actually returns 0!

Step 3: Serendipity

My mentee was a bit surprised to hear this was a problems since all his tests were passing. It turns out that our tests had come from the actual Underscore test suite and not a single test in the suite used multiplication in its anonymous function. Our instructor said essentially the same thing Jeff Dickey did. "Be bold, fix it and make the pull request!".

Step 4: Touching octocat tentacles with the jashkanas



Conclusion: There's no down-side to helping out!

Here were my main take-aways:

  1. It's easy to contribute on git hub! You just have to fork a repo, download it, make your changes, commit and push them back up and then do a pull request. It sounds like a lot but it's really not as difficult as I had imagined.
  2. Contributing tests is especially easy. There's no chance of stepping on others' toes as there would be with new feature proposals. You're just strengthening what the original author envisioned.

Leave a Reply

Your email address will not be published. Required fields are marked *