News for hackers. Stuff that matters.
Re:Why blocks make Ruby methods slower by zem on Friday February 27, 2015 @05:40PM (#9121831)
i meant that it's a natural thing to do in ruby to implement patterns like open/yield/close or decorate/sort/undecorate as methods that yield to a block. with-open-file was probably a bad example, but from experience it does change the feel of the language when you have to explicitly specify a closure argument versus when you just expect that your method should allow for a block to be attached to the method call. i'm not saying that these things aren't possible in other languages, just that ruby's "free" block makes them a culturally default thing to do.

There are no comments on this comment yet.