Who knew that coding could be such a social activity! I really like GitHub, with its ability to fork people’s code base, apply your own changes, offer it up to be merged back in, see the difference logs, comment on the difference logs … ah, now that last one’s genius!
Somebody happened upon this quiet little commit from DHH … yes, the DHH, creator of Ruby on Rails. The bright spark goes and posts it to Reddit, prompting the world and its duck to chime in with an opinion! It’s quite funny reading through the comments, both on Reddit and on GitHub.
What does the commit do? Not a lot. It’s what we call syntactic sugar: aliasing something in code as something else. It means we’ll be able to do this:
['a', 'b', 'c', 'd'].third => 'c'
Of course, i have an opinion too. I can see why it could be useful, but i don’t really think it is worthy of being in the Rails core code. I doubt i will ever use it. I also agree with the person who says it widens the gap between Ruby and Rails. When
Array#first is available in Ruby, people will wonder why
Array#second is not.
I do wonder, if anyone other than DHH had submitted this ‘patch’, whether it would have been accepted into core Rails.
After laughing at this thread over lunch today, one of my colleagues sent me an instant message:
I think it’s good that people are looking at the commits, seeing what’s going into Rails, and having their say about it. This is community-driven development at its best! Cheers, GitHub! :)
Update: DHH has responded! It now only goes up to fifth … but
Array#forty_two has been added in as compensation! DHH calls it accessing “the reddit”.