News for hackers. Stuff that matters.
Re:My Beef with RuboCop by adamzapasnik on Thursday November 19, 2020 @06:11AM (#25148332)
I don't get what is the big problem. Just turn off the disturbing Cop. It's a linter not an AI-Linter to know what is expected.

I don't even think that this is RuboCop's fault but Ruby's. Because you can write said code in a lot of different ways (like shown in the post).

Re:My Beef with RuboCop by jldugger on Thursday November 19, 2020 @03:46PM (#25154145)
> I don't even think that this is RuboCop's fault but Ruby's. Because you can write said code in a lot of different ways (like shown in the post).

Honestly, the problem is that rubocop was not designed by a community of experts. It started as the opinions of a singular person, one motivated to the point of writing a linter where none existed. As a result, it's heavily opinionated on trivial shit. Yes, you can configure it, but the out-of-box experience is overbearing.

I generally prefer https://relaxed.ruby.style which is ... a lot more chill.

Re:My Beef with RuboCop by rubyist5eva on Thursday November 19, 2020 @08:13AM (#25149121)
Exactly - you don't even need to turn it off globally, just add the magic comment and then an explanation for why you are being explicit about returning nil. ezpz
Re:My Beef with RuboCop by masa331 on Thursday November 19, 2020 @07:16AM (#25148743)
The thing that you can write said code in a lot of different ways is not a fault but a feature for which Ruby is loved by many. As can be also seen from the article it lets a programmer to be neatly expressive in various different situations.

Now if you personally don't like this feature you should probably use a language which feature is that you can write a thing only in one way and no other.