Ruby 再回顾一遍 Ruby Gotchas

tumayun · 2014年04月29日 · 最后由 tumayun 回复于 2014年04月30日 · 2591 次阅读
  • and / or is NOT the same as && / ||
  • super is NOT the same as super()
  • Your exception must not be an Exception
  • class Foo::Bar is NOT the same as module Foo; class Bar
  • Most bang! methods return nil when they do nothing
  • attribute=(value) method always returns passed value, regardless of method return value
  • private will NOT make your self.method private

http://ruby-china.org/topics/17742

这精华加的太随便了吧,现在这种加精华的方式还不如以前按喜欢来排列,至少以前的方式就不会出现这种问题。

精华帖泛滥了已经 以前都明确要求原创的啊

我取消精华了。

mark,谢分享

呀 被加精有取消了?只是分享下,精不精华无所谓啦

需要 登录 后方可回复, 如果你还没有账号请 注册新账号