News for hackers. Stuff that matters.
Re:Rails is not written in Ruby by ajmurmann on Friday February 04, 2022 @05:29PM (#30214281)
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.

There are no comments on this comment yet.