This post originated from an RSS feed registered with Agile Buzz
by James Robertson.
Original Post: Joel Discovers Blocks
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
Joel Spolsky has just discovered the beauty of anonymous functions:
Jeez, that is handy. Notice that I'm creating a function there on the fly, not even bothering to name it, just picking it up by its ears and tossing it into a function.
As soon as you start thinking in terms of anonymous functions as arguments, you might notice code all over the place that, say, does something to every element of an array.
He then notes that some older languages don't allow this, and makes an assumption:
Many older languages simply had no way to do this kind of stuff. Other languages let you do it, but it's hard (for example, C has function pointers, but you have to declare and define the function somewhere else). Object-oriented programming languages aren't completely convinced that you should be allowed to do anything with functions.
Java required you to create a whole object with a single method called a functor if you wanted to treat a function like a first class object. Combine that with the fact that many OO languages want you to create a whole file for each class, and it gets really klunky fast. If your programming language requires you to use functors, you're not getting all the benefits of a modern programming environment. See if you can get some of your money back.
Yet again, I have to point out that Smalltalk had this back in the 80's. Java didn't because it's a dumbed down language with training wheels, which is supposed to somehow add power. Umm, right.
Perhaps Joel should have a look at Smalltalk, and see what else he's missed :)