Learning Ruby: First Impressions
I’ve been a LAMP guy for about 12 years. Before that I wrote Perl and ColdFusion. With the start of a new job I’ve been learning Ruby. I’m only about a week or so in, but here are my initial thoughts so far:
The Bad
- First, and maybe most importantly, the Ruby documentation sucks. Hard. Compare the level of information and useful search features of PHP.net to Ruby-Doc.org. The former is highly detailed, easily searchable and very helpful. The latter is a little barren, and really shows the immaturity of Ruby as a production language in comparison to PHP.
- Ruby has this weird habit of renaming common conventions for no apparent reason. Where nearly every other programming language uses NULL, Ruby has to be special and use nil instead. This is pointless obfuscation.
- Where most other languages use uppercase and lowercase to refer to the obvious, Ruby uses upcase and downcase. Why? Who the fuck knows.
- The puts() method is poorly named too. It’s equivalent to echo() but isn’t called echo because that would be lame, I guess. I’ve tried to find logical reasons for these weird names and there are none. It really does just come down to Ruby having this strange egotistical need to be different. It’s apparently the hipster of programming languages, and I want to smack its ironic handlebar moustache right off of its douchey face.
- Constantly having to start and stop the Rails server via command line is irritating. I love my bash shell and am extremely comfortable there, but it seems like a waste of time to have to restart the server when making edits to my app.
- The Rails console is too cool for decent formatting. When asking for a dump of an object, instead of returning easily readable blocks of text with line breaks it just barfs out a hairball of unformatted text and expects you to dig through it with a comb to find what you’re after. This is profoundly stupid.
- Installation is a messy, convoluted process for both Ruby and Rails. I’m sure a large part of my feeling on this is a result of being new to Ruby and Rails, but the installation was riddled with dependency and compile errors on my OSX machine. I’m no stranger to command-line installations, GCC, make and so on.... but the fact that there is no simple install bundle is surprising. And no, Homebrew doesn’t count. Compare, once again, to PHP. In contrast to Ruby and Rails, PHP is ridiculously easy to install and configure even without using the excellent MAMP bundle.
The Good
- Ruby is clean. Really clean. I’m rather used to ending lines with a semicolon, not caring very much about whitespace (allowing me to cleanly format my code however I like), and prefixing variables with the easily recognizable $. Skimming Ruby code, at first, is a little more difficult because Ruby is so clean. Everything looks the same and it’s not as easy at a glance to differentiate between variables, classes, functions and so on. The more I use and learn it, the more that clean simplicity is growing on me.
Overall? Meh.
And that’s it. I don’t have any other good points yet. Many of the irritations I’m seeing are the result of changes as I learn more. I fully expect that I’m wrong about many of these things (and hope that I am). And the issue may be Rails rather then Ruby itself so I’m reluctant to lump their faults together. We’ll see if that opinion so please let me know if you feel differently. I want to like Ruby, but it’s not impressing me thus far.