IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New It isn't just you though
I've seen a lot of people from Smalltalk environments who are perfectly happy to use an array with a detect method where something like a hash would make a lot more sense.

I have been left to wonder if they got in the habit of abstracting so far that they forgot the algorithm implications of their choices?

Cheers,
Ben
"good ideas and bad code build communities, the other three combinations do not"
- [link|http://archives.real-time.com/pipermail/cocoon-devel/2000-October/003023.html|Stefano Mazzocchi]
New I know what you mean
But you can't really just say something like SortedCollection should implement #detect: as binary search. Its a general purpose method and the aspect you are searching on may not have anything at all to do with the sort ordering.

I've found some find: methods that return the index. But again, because of the nature of the evaluation block, they do a linear search. I've spent a few minutes looking for a #binarySearch: or similar and haven't found one. Of course, you can add one without much effort.

Smalltalk culture is pretty much about efficiency of coding - with efficiency of implementation being seldom considered until its crucial.

Actually, there appear to be 2 cults - one dedicated to elegant simplicity of coding - which is nearly everybody - and the other dedicated to really clever (and transparent) optimizations - like the people working on croquet that are transparently offloading graphics operations to hardware as much as possible - or the people who work on the VMs.



"I believe that many of the systems we build today in Java would be better built in Smalltalk and Gemstone."

     -- Martin Fowler, JAOO 2003
     Smalltalk question - (Arkadiy) - (19)
         What's the unsolved part? -NT - (tuberculosis) - (1)
             The original problem - (Arkadiy)
         Why not solve it like you would in any language? - (ben_tilly) - (16)
             That is the problem I solved - (Arkadiy) - (15)
                 2 ways - (Simon_Jester) - (11)
                     Re: 2 ways - (Arkadiy) - (10)
                         The iterator doesn't change the algorithm (with assumption) - (Simon_Jester) - (3)
                             Smalltalk iterators are different - (Arkadiy) - (2)
                                 Okay...so your 'cheat' is the method - (Simon_Jester) - (1)
                                     see my answer to Ben below... -NT - (Arkadiy)
                         Some iterators do provide indexes - (tuberculosis) - (5)
                             Yay! - (Arkadiy)
                             Why worry about that factor of 2? - (ben_tilly) - (3)
                                 Habit, I suppose - (tuberculosis) - (2)
                                     It isn't just you though - (ben_tilly) - (1)
                                         I know what you mean - (tuberculosis)
                 Here is my second strategy in Ruby - (ben_tilly) - (2)
                     I realized that introducing a bucket class makes it easy - (Arkadiy) - (1)
                         Elegance is in the eye of the beholder - (ben_tilly)

Don't touch that channel!
108 ms