`
Hooopo
  • 浏览: 336023 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

what Ruby knowledge should you have?

阅读更多

This is sort of from the top of my head; I'm sure I am missing a lot. Besides the things mentioned here, understanding programming and object-oriented programming in particular is a must, of course.

A few important language features:

  • Realise that in Ruby, everything is an expression, and be able to apply that principle, even if you think it makes your code unreadable.
  • Closures are mentioned; I would also expect Rubyists to know the differences between blocks and procs (and lambdas) and know how to convert between them. Closure mastery is important to being able to write beautiful Ruby, in my opinion.
  • Operator overloading: know what happens when you define methods named [][]===+<<, etc. on an object.
  • Be proficient with most instance methods of ArrayEnumerable and Hash (even if you don't know the exact definition by heart). Your Ruby code will be so much more verbose if you don't use methods like collectinjectjoinzip, etc. where appropriate.
  • Thoroughly understand what Symbols are, and when you should use / avoid them.
  • Understand what metaclasses are, know the difference between class variables and class instance variables.
  • Know how object attributes work in Ruby, how you can define them with attr_accessor and friends, and how you can define them yourself.
  • Be able to use modules, both as mix-ins and as namespacing tool. You should also understand how to mix-in instance methods and class methods (or be able to figure out how you could do it).
  • Know the difference between raise/rescue and throw/catch, and be able to use both correctly.
  • Understand how metaprogramming works, and at least have a basic idea of all the methods that allow you to do metaprogramming (mostly hidden in the classes Module and Object).
  • Be able to use a Hash method argument as a substitute for named arguments (even if it's just because it's a common pattern).
  • Know how concurrency does and doesn't work in Ruby.
  • Continuations, even if they're rarely used.

Some vital tools:

  • Know and understand Ruby gems
  • and rake
  • and RDoc.
  • and YAML.

Some framework knowledge:

  • Basic knowledge of Rails would be useful. Even if it's only because the outside world sometimes doesn't seem to know the difference between Rails and Ruby.
  • Know there are other web frameworks than Rails: Merb, Sinatra, Camping, ...

Ultimately, keep in mind that the above is "just knowledge", and not skills. It's probably easy to pick up most of this if you're not familiar with it.


分享到:
评论
2 楼 Hooopo 2011-09-27  
orcl_zhang 写道
最后两个,真的不太了解:
Know how concurrency does and doesn't work in Ruby.
Continuations, even if they're rarely used.

说的就是Ruby的线程机制和协程/纤程呀
1 楼 orcl_zhang 2011-09-27  
最后两个,真的不太了解:
Know how concurrency does and doesn't work in Ruby.
Continuations, even if they're rarely used.

相关推荐

Global site tag (gtag.js) - Google Analytics