Re:“A closure is a poor man’s object; an object is a poor ma...
by lacampbell on Monday May 01, 2017 @03:53AM
(#14236167)
I think in those examples, there are probably smaller objects hiding inside your bigger objects, and you should construct them first.
FYI ruby has named arguments since a few versions back.
Re:“A closure is a poor man’s object; an object is a poor ma...
by jwdunne on Monday May 01, 2017 @05:14AM
(#14236389)
I think you're probably right. That's the ideal.
Thanks for letting me know - can't believe I missed that. I don't use Ruby professionally, just as a scripting language to make my life at work easier.
I think, however, they're a good way of building objects where a language lacks object or hashmap shorthand (e.g JS and Ruby). In fact, with Obj-C, if my memory serves right, it can look just as expressive.
Setters (particularly fluent), in that case, seem best for building objects in a readable way where a language lacks a way to pass express keyword arguments.