This post originated from an RSS feed registered with Agile Buzz
by James Robertson.
Original Post: Guess the number of performs:
Feed Title: Travis Griggs - Blog
Feed URL: http://www.cincomsmalltalk.com/rssBlog/travis-rss.xml
Feed Description: This TAG Line is Extra
Ever been to a party where they play that game where you have to guess how many jelly beans are in the jar? If you had to guess how many call sites there are for perform: and variants (with:, with:with:, with:with:with:, withArguments:), what would you guess?
I've known how powerful perform: is for a long time. One of the things that makes it such a joy to use in Smalltalk vs other languages with similiar knock-off facilities, is how relatively terse, straightforward, and simple the Smaltalk approach is. That aside, I guess I always thought it was one of those powerful features that benefited the system greatly, but was not actually referred to in that many places. Maybe a couple of high traffic spots, but certainly not a large number of call sites making use of it.
I needed to find references to perform: and friends in one of my applications the other day so I could isolate and abstract it. In doing so I got curious as to just how many senders of perform: and friends there are. I used this code snippet to find the answer:
In an image with Store and and the RB and my standard tools, but none of the applications I've been working on, I get 471.
What would you have guessed? I was actually surprised at how many there are and would not have guessed that many. Albeit, said image has ~57000 methods in it, so this is still just under 1%. It would be interesting to know how widespread the use of the same Java facilities is in an IDE like Eclipse.