Is it good style to explicitly return in Ruby?

前端 未结 8 2160
暗喜
暗喜 2020-11-27 10:59

Coming from a Python background, where there is always a \"right way to do it\" (a \"Pythonic\" way) when it comes to style, I\'m wondering if the same exists for Ruby. I\'v

8条回答
  •  清酒与你
    2020-11-27 11:30

    It's a matter of which style you prefer for the most part. You do have to use the keyword return if you want to return from somewhere in the middle of a method.

提交回复
热议问题