瞎扯淡 There Is More Than One Way To Do It, Ruby 风格问题

spacewander · December 18, 2014 · Last by spacewander replied at December 19, 2014 · 1997 hits

开一个帖子解决我长期的疑惑:

1. 是喜欢用

if !condition

还是用

unless condition

2. 是喜欢用

do_something()

还是用

do_something

3. 是喜欢用

  return xxx
end

还是用

  xxx
end

喜欢甜的还是咸的都没关系,只要你能说出你的理由。(当然你也可以根据本日运程选择使用哪种风格,只要理由说得通 😅

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