News for hackers. Stuff that matters.
Re:My Beef with RuboCop by dragonwriter on Thursday November 19, 2020 @04:05PM (#25154346)
> The explicit nil in the original implementation implies that the method is being called for its return value — that it’s probably functional, with inconsequential side effects.

> Making the nil implicit says that the return value is not important. This method now reads like it’s implemented by avoiding side effects within super.

That's...not my understanding of idiomatic ruby conventions. The idea that a method is assumed to have no or inconsequential side effects and be called only for its return value with an explicit return, but to be called for side effects with an implicit one, is a Python idiom, not a Ruby idiom. As I understand Ruby idiom, it is basically "a method defined with `def` is assumed to have both significant side effects and a significant return value unless documented otherwise on either point, except that a method with a name ending in `?` is assumed to return a value meaningful in a boolean context and have no or inconsequential side effects." Concise function bodies with implicit nil returns are normal, including for functions called for their return value.

There are no comments on this comment yet.