The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Guess the number of performs:

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Guess the number of performs: Posted: Sep 1, 2004 12:37 PM
Reply to this message Reply

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
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Travis Griggs - Blog

Advertisement
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:

mc := MethodCollector new.
((mc referencesTo: #perform:) | (mc referencesTo: #perform:with:) 
	| (mc referencesTo: #perform:with:with:) 
		| (mc referencesTo: #perform:with:with:with:) 
		| (mc referencesTo: #perform:withArguments:)) select

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.

Read: Guess the number of performs:

Topic: Disney Days Previous Topic   Next Topic Topic: Cincom's President Nies interviewed

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use