4 ms·
The title should be amended to point out that this is from 2003. My summary of the difference has always been, "Objects make good nouns while closures make goo
by btilly 17y ago
The title should be amended to point out that this is from 2003.
My summary of the difference has always been, "Objects make good nouns while closures make good verbs."
- barrkel 17y agoUnfortunately, in many situations you also need to ask noun-like questions about your closures. For things like loop bodies, conditionals passed to filters, comparisons passed to sorts, etc., closures work very well. But when you start using a closure to e.g. represent an I/O endpoint (e.g. () => string for reading, string => () for writing to / from a console), you'll also want to do things like flush buffers.
- btilly 17y agoThat's why closures are a poor man's objects. :-)
- loup-vaillant 17y agoWhen, not why :-)