Experience on first open source coding
For a while now I’ve been working with Ruby. It has been a great experience from day 1, specially coming from non-framework PHP and JAVA environments.
For me (and I’m guessing for most rubyists) the thing that really shines in ruby is the community, there are great people contributing with code, tutorials and screencasts. Of course the language per se is great on its own but it wouldn’t be what it is right now if it weren’t because of open source code like the all mighty Rails.
At Innku, we use A LOT of open source. It has been a great learning experience using (and looking at) some amazing code right from the hands of experts like @dhh, @technoweenie or @wycats. Since ruby makes it so easy to reuse code, at first, everything seems like magic.
gem install some_great_functionality
You just build a wishlist of features, look them up on github and about 30% of your application is ready before you even start coding. Pretty great.
If you look at this scenario from a strictly productive point of view, it makes perfect sense. It actually sounds pretty stupid to be building and rebuilding some common functionality (Login to the application, upload a user avatar, hack through ie’s crap javascript interpretation) when you can just reuse your code or (even better) use the code someone else built that does exactly what you want.
So that is what we did, reuse great code. Up until now.
At Innku I’ve been working on a bunch of projects so far, and in the process I’ve noticed some rebuilding so a couple of days ago decided to put this functionality into a gem (code you and others can reuse in ruby). Getting started was pretty easy with RubyGems.org.
Yesterday was my first test and publishing the gem was easy, looking into code I’ve been using from other people guided me along the way and after a couple of failed attempts I had the 0.1.0 version of my gem online (so far with 9 downloads). It is still a work in progress but like I said it was my first attempt.
Today, I encountered another reusable piece of code, very simple but very practical so I decided to give it a second try. It was easier than yesterday and I was able to complete the functionality I had in mind. So right now, it’s out there, in the wild (I’ll post on the specifics later). Feels pretty good to give something back to the community, specially since the code I built into the gem is a ‘Scratch my own itch’ kind of functionality so if it works for me, it’ll probably work for some other dude out there.
I think open source should be just that, be useful to you and then to the rest. Tools that are built to be sold and not to be used usually suck. Rails was born that way and I think all the open source I build will be like that.