I’m a developer. But as a developer, I’m fairly faithful. I really seriously started programming with PHP. I learned and used this language thouroughly. I consider myself an expert programmer in this language.
So as you probably guessed with this article’s title, I’ve decided to learn Ruby. And I just figured out that I should document this journey. I don’t know if it’ll help anybody but, heh, why not? So to be fair, I’ve tried Ruby before. Not very seriously. And because of this blog actually. It’s built on Jekyll which is written in Ruby. When I wanted to change some stuff I realized I should probably learn Ruby first.
This introduction is already way too long so let’s get to the point.
- Ruby is a pretty cool language, clearly designed for the convenience of the developer, with a lot of alternative syntaxes and shortcuts. The language is, I feel, sometimes a bit too forgiving, leaving the developer free to write bad code without realizing it.
- Gems seem to be a lot better than PHP’s PEAR.
- The documentation is huge, a bit too much actually. My first tries at Ruby were a bit rushed. I’ve been hearing praises for Ruby On Rails for so long, I tried to learn the language through RoR. Even though there is a lot of good tutorials, you should start by learning Ruby first, RoR second. So, I got the Learning Ruby book and just read it. It’s not a perfect book, I feel it sometimes even expressed dangerous opinions for junior developers. But if you want to learn the basics of the language, it does the trick.
- Still regarding the documentation, for whatever reason, it’s hard for me to understand the reference documentation. It’s just a mess for me. I tried to learn the language with a small program that manipulate file paths. In other words, strings. When I started looking for a way to use Regexp, I hit a wall. Where is the legend? Where is the real life example? Oh I see, I have to use the
newmethod to transform a string in a pattern. I mean, the php.net documentation is not that good but a least you get examples in their context…
- I took me 2 hours and a lot of digging to understand why my
require 'json'directive didn’t work even though I had installed the gem. Actually, I still don’t understand why, I just found that with
require 'rubygems'before, it was working.
- Even though Ruby is installed by default on Mac OS X, some struff doesn’t really work well. Or I just broke it earlier digging in my system. I’m currently using the macports version of Ruby (1.8.7). I may eventually decide to compile it myself or use rvm.
So, for the couple of geeks that’ll read this, if you know soemthing about Ruby, have advices, books I should read, please let me know in the comments :)