Marc-André Lafortune

Results 450 comments of Marc-André Lafortune

@jcoyne Indeed, this method has no body. *Yet*. By not wanting to invoke `super`, you are preventing that class to refactor it's initializer without breaking compatibility. Moreover I'll note that...

This PR still needs work... It's true one should not raise an `Exception`, but it is not true one should raise a `StandardException`; it's more an abstract base class than...

> In my book, there's only excuses for using `&method`. > > It's when it's either hard to come up with clear parameter names: > > ```ruby > chaos =...

Where I think we don't agree is that yielding is usually 1 element. Even `Hash#each` has been modified to yield `[key, value]` instead of 2 elements. This is not typically...

😆 > Should we consider .with_index/.with_object/inject when talking about &method? max/min/sort? slice_when/chunk_while? zip? Chained chunk? I don't think so. There's only [a single case of `&method` in RuboCop](https://github.com/rubocop-hq/rubocop/blob/master/lib/rubocop/cop/mixin/preceding_following_alignment.rb#L14-L20) and it's...

I strongly disagree. 1) `Array#take` has no reason to exist whatsover. Use `Array#first(n)` (or `array[...n]`). 2) I never use `Array#drop`. Needing it is less frequent anyways, but if I need...

I reopened this issue as I think it is a worthwhile discussion and it might change. I personally like `private def`. This is the style I am using in [the...

@pirj I don't think the order is in question. Note that `private` and al. are now even nicer idioms in Ruby 3.0 because we can now write: ``` protected attr_accessor...

> easier understand in what class the method is defined Actually, that's a valid point, but that's also why we typically have a rule for this: one (big) class per...

I wouldn't mind resurrecting this thread. tldnr: I would reverse that rule, i.e. favor `extend self` and avoid `module_function`, or at least not provide any definite recommendation and list the...