Ruby 再回顾一遍 Ruby Gotchas

tumayun · April 29, 2014 · Last by tumayun replied at April 30, 2014 · 2590 hits
  • 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,谢分享

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

You need to Sign in before reply, if you don't have an account, please Sign up first.