3 ms·
I agree -- the article recommendations are generally subjective/oversimplified. Except for point 5, which is a almost always a mistake of using the "tool at han
by quesera 2y ago
I agree -- the article recommendations are generally subjective/oversimplified. Except for point 5, which is a almost always a mistake of using the "tool at hand" (Ruby), and not knowing when to switch to a more appropriate layer (Active Record or SQL).
But what's wrong with an instantiated hash as kwargs? :)
- chucke 2y agoIt isn't a big win compared to just calling the method with it: meth(foo: 1, bar: 2) # even if multiline meth( foo: 1, bar: 2 ) while needlessly allocating an hash (kwargs optimize that).
- quesera 2y agoFor this small example, I certainly agree. But I like to use a prepared hash when there's preparation that must be done, or if it just makes the data more clear.