2 ms·
I think you are right that the solution where you pass the array in is clearer and probably more maintainable. It doesn't seem object-oriented at all though. It
by ajmurmann 5y ago
I think you are right that the solution where you pass the array in is clearer and probably more maintainable. It doesn't seem object-oriented at all though. It also leads to a totally different look and feel between built-in and extensions. It's not idiomatic at all.
So, I think it's fair to say that the advantages you are lay out are more tangible than the other side of the trade-off.
Having written too much Ruby code I'd still cringe every time I have to pass the array.
Edit: To make it actually clean it should be 'MyArrayLib.has_my_things(array)'. Still really dislike it despite all the logical arguments for it.