Thursday, December 20, 2012

Social Coding, Why Did I Wait So Long?

I have been pretty active on Github for the past couple weeks.  Over the previous six months I have used Github to host my code so I could push to Heroku.  I also found myself on Github reading wikis or readme files for some of the gems I use.  As a beginner, I did not feel comfortable getting any more involved in the open source community.

A couple weeks ago I was watching my server logs and thought to myself "Wow, this favicon error that keeps popping up in my logs is really annoying."  It did not stop anything from running, but every call to a view in my app had an error that the favicon path could not be found.  I saw this error in a couple of my apps, and decided to find out what was causing it.  Come to find out the favicon path was being called in my application layout, which was generated by the twitter-bootstrap-rails gem.  It was a simple fix from what I could see.  I just needed to change favicon_link_tag 'images/favicon.ico' to favicon_link_tag 'favicon.ico'.  I changed my code in the application layout, and sure enough it worked.

When I was going through Code Academy (now The Starter League), we were encouraged to get our feet wet by helping out on some open source projects.  I always have been afraid to get involved.  To be honest I was not even sure how to get involved.  This seemed like a really easy fix to make, and I could get my feet wet by contributing to a project.  I went to Github, forked a copy of the project, and started digging through the files.  I realized the folder structure of this project was much different then I was used to with a Rails app.  There were generators, themes, and everything seemed different from what I was used to.  I was finally able to find the generator files that produce the application layout code, and revised the faulty favicon area.  I had to update erb, haml, and slim versions of the layout.  Now that I revised the code, what in the world was I supposed to do to get it back into the main project?

I searched Github and found their documentation to be very easy to follow.  All I needed to do was create a pull request.  As I created the pull request I started to get very nervous.  What if I did something wrong?  What if my code breaks the project?  I have errors in simple code all the time, so how was I to insure I did not overlook something in my little late night experiment?  I figured there was only one way to find out or learn my mistakes, and that is to submit the pull request.  Three hours later my pull request was merged into the project.

I know the change I made was really simple, but I was overjoyed that I was able to finally get my feet wet on a major project.  This also gave me some confidence to dive into the open issues and try to help out others.  Some questions were easily answered, and others were far more complex for me to handle.  One of the open issues was based off of the fact that the read me file was not clear about "fluid" meaning a responsive design.  I updated the readme file, created a new pull request, and this morning that change was merged as well.

Last week I also forked another gem to create a custom version of it for me.  The gem is called blogit.  I needed to customize some of the views and functionality for creating the Reading Glue blog.  I keep the modified version of the gem on my Github account, and can update my apps gem directly by the link back to my version on Github.  For the most part this gem resembles a normal rails app.  It was easier to know where to find files, and to understand what I am looking at.  It was also a great way to dive into more complicated code, and learn better ways to refactor my own code in the future.

One year ago I had no clue how to code outside of some very basic html and javascript.  Nine months ago I started looking at Ruby on Rails, and felt overwhelmed.  Fast forward to the present and I am feeling comfortable contributing to open source projects or forking other people's code for my own customizations.  I am not sure why I chose to wait so long to start using Github for social coding.  Maybe it was just a fear of getting involved and failing in front of the world.  I did not realize the learning benefits that come from contributing to the open source community.

Are you learning to code and only using Github as a way to store your code?  I highly recommend getting involved in a project.  Even if it is closing out open issues, updating a readme file, or something else that is simple.  You likely have the skill set to help out in some way, and I guarantee you will learn more as you continue to stay connected to the project.
Post a Comment