« Questions | Main | RIFE: Continuations in a Java Web Framework? »

Closures Considered Neat

Don Box on Scheme:

What I love about this approach [using closures] versus defining a class is that I didn't need to go through the standard 20 questions one typically asks themselves when writing a new class. No class versus struct, interface versus abstract base, or other analysis was necessary. Instead I wrote a program that did what I wanted it to do. Period.

A lot of OO programmers are under the impression that everything should be a class, but there's a lot of baggage that comes with that. Sometimes, indeed, you just need a quickie function: a closure.

Post a comment