Hacking to the Gate

Latest Posts

For anyone who already had some programming experience and wants to play with Ruby but somehow impeded by, or just fail to find any logics but coarse information in the so called Ruby Handbook, Koans may be a amazing alternative for you to try.

I’m always wandering that, as a dynamic and reflective programming language, Ruby is fully capable to explains itself clearly, without any chunky handbook. Ruby is designed for programmer productivity and fun, and with this purpose it’s syntaxs and method names are meticulously considered to be intuitive, showing the similar form of nature language, which thousands of elegant Ruby one liners assured. I’m gonna show you an example.

1# to make every word in a paragraph capitalized2@paragraph.split.map!(&:capitalize).join(' ')34# a shorter and more skillful approach5@paragraph.gsub!(/\S+/,&:capitalize)

From my perspective, instigating somebody to reading the alleged Ruby Handbook is ruining the language, as Jim Weirich and Joe O’Brien, the author of Koans, may agree with. However, they didn’t just hold this point of view, but ultimately build up this helper, which earned my respect spontaneously.

So, if I’ve already attracted your attending, and you are ready for this journey. Then follow me, I’ll point out a path to enlightenment that leading you to cross the Gate of Ruby and witness it’s inner beauty.

Just now I finished the barely-running version of this little project, seriously using Ruby(actually MacRuby, I will mention it later) for the first time.

Althrough I fell in love with Ruby the first time I saw it, I didn’t realize that writting with Ruby is such a pleasure. A GUI program using multithread tech and carefully handling exceptions is written in only 200+ lines, which seems impossible to Objective-C(I should have used it if I didn’t see MacRuby). Before talking about the details, I remind you that the project is avaliable in my github repo. Feel free to give me some feedbacks.

Background

In 2003, just two years after the online encyclopedia’s birth, Wikipedia was still not well known, and among those aware of it there was serious skepticism about its open authorship model. Researcher Martin Wattenberg and Fernanda Viégas felt some of this skepticism themselves, yet many of the articles were interesting and helpful. To find out how was such a haphazard process yielding a quality product and other related questions, they decided to investigate. They did a lot of works and most of them are masterpieces. I’ll focus mainly on the History Flow part which I think is beautiful and useful.