New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is return nil
a bad style?
#557
Comments
...deleted my previous posts as I misunderstood your point I think most of condition
|
@equivalent - |
@BroiSatse I stand my ground :)
the style of code I'm arguing has somewhat base in functional programming rules where you want every method to have one outcome and one may argue but this is has nothing to do with OOP, well to be honest it does, as part of single responsibility principle ( therefore code is easily extendable
|
@equivalent - #standmyground :) https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals |
yep agree once it's there it's there and there is nothing for me to do than obey the rules :) that's one fight I've already lost. Still doh, the argument is still there and I take any chance to bring it up to discussion again :) (e.g. your GH issue) |
Well those are not strictly rules, I agree that there are cases when |
IMO, assuming you have good reason to use Also, |
I would argue that the semantics are slightly different. If I see |
@codebycliff I completely agree. |
OCD in action: One might argue that
return nil
is slightly more expressive thanreturn
, however I have rather fixed feelings about such a construct. Should it be advised against as a bad style?The text was updated successfully, but these errors were encountered: