ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Ruby开发者应该明了的15件事

Ruby开发者应该明了的15件事

原创 Linux操作系统 作者:jieforest 时间:2012-06-09 02:37:31 0 删除 编辑
[i=s] 本帖最后由 jieforest 于 2012-6-9 02:33 编辑

The following is a post I had recently sent the Bangalore Ruby User Group. It has been slightly modified to address a larger audience.

There were many Ruby beginners in last week's meetup, and the common question we heard was 'after the very basics, what next?'

The best way to learn Ruby best practices is to pair with an experienced dev; the way I learned was by inheriting a reasonably small, but well-written codebase from an amazing colleague. In the absence of either, here is a checklist of 15 things (since 'N things that you need to know about X' is the in-thing these days!) that I'd recommend a Ruby beginner to consider:

1. The very basics

Our very own rubymonk.com has a Ruby primer which was written for exactly this purpose; we open our inbox everyday to gushing feedback from people who've found it to be a great way to learn Ruby. Try it and let us know how it goes!
tryruby.org also has a basic introduction to Ruby, and has been around longer. Edgecase's Ruby Koan is an interesting concept, and covers the language both in breadth and depth, and is a very strong recommendation. It should take you anywhere between 5-10 hours to finish all of the Koans. Do try it!

I have heard good things about Learn Ruby the Hardway, but haven't tried it out myself. Okay, I just skimmed through portions of it and I'm not really happy - LRTH seems to be mostly a line-to-line translation of Python code to Ruby. It uses  'while' loop in places where equivalent Ruby idioms (Enumerables) would have made more sense. Also there is no mention of blocks, metaprogramming and duck-typing, which pretty much is a deal-breaker for me. But to be fair, the target audience for LRTH seem to be non-programmers for whom the concept of loops and objects would be new, and for them it does the job very well.

Wait, have you read Why's Poignant Guide to Ruby? If this is the first time you're hearing about why the lucky stiff, read this amazing piece on _why by the Smashing Magazine. And definitely read The Poignant Guide: http://mislav.uniqpath.com/poignant-guide/. It is full of cats, foxes, chunky bacon, cartoons that doesn't always make much sense, space travel and what not. This was one of my first introductions to the Ruby community, and the guide lent the language and the community a fun, quirky and happy aura. You may or may not take away much Ruby knowledge from the guide - I couldn't when I read it for the first time. However you'll definitely understand some of the quirkiness and philosophies that influence the Ruby community. I'm a huge fan of _why, and here is my favourite quote:

CODE:

when you don't create things, you become defined by your tastes rather than ability. your tastes only narrow & exclude people. so create.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/301743/viewspace-732334/,如需转载,请注明出处,否则将追究法律责任。

上一篇: Node.js 0.6.19发布
请登录后发表评论 登录
全部评论

注册时间:2008-04-23

  • 博文量
    443
  • 访问量
    508332