Ben Tilly wrote:
> Tom Metro wrote:
>> The closure version doesn't "scale." You can't stick it in a library and
>> call it from multiple places without stepping on things.
> 
> I've seen closure based solutions and OO versions both scale, and
> both fail.  They are appropriate for different problems, and
> different designs.  But as long as you know what they are (and
> aren't) good at, you can choose either.

I agree. For this use case, the sample code proposed wouldn't "scale"
and wold require additional complexity to make it do so. Plus, the end
result would be something far more likely to trip up the next programmer
to look at it, which may be your future self. (I guess if you and your
colleagues are closure fans, that wouldn't apply. In a typical shop, it
would.)

I'm not saying a design using closures can't scale. I'm just saying if
you have a problem that decomposes well to an OO design, and you have no
special requirements motivating you not to use OO, that should be the
default. (Not in a draconian, "you must do OO" way, but in a "the
language makes it super convenient" way.)

 -Tom

-- 
Tom Metro
Venture Logic, Newton, MA, USA
"Enterprise solutions through open source."
Professional Profile: http://tmetro.venturelogic.com/

_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to