In the most respected programming languages, functions -- such as the act of squaring a number, or of taking its cosine -- are what computer scientists term "first class values". They can be stored in variables, and calculated with by passing them into and out of other functions. Such languages thereby become hugely versatile.
"Object-oriented languages" such as Java, on the other hand, put functions in bondage. They name them "methods" and tie them to objects, making it impossible to use them freely. This has never seemed sensible to me -- function is, after all, only the most important concept in the whole of mathematics. It didn't seem sensible to Dobbs blogger Bill Lewis either, who posted a piece about it titled How much would you pay for a closure? ("Closures" are a trick in computing that helps a language make functions into first class values.) So I drew this cartoon in sympathy with his views.

Leave a comment