Skip to main content Accessibility help
×
Hostname: page-component-7479d7b7d-68ccn Total loading time: 0 Render date: 2024-07-11T19:12:56.130Z Has data issue: false hasContentIssue false

10 - COLLECTION IDIOMS

Smalltalk Report, November–December, 1992

Published online by Cambridge University Press:  04 August 2010

Kent Beck
Affiliation:
First Class Software, Inc.
Get access

Summary

If you have read The Smalltalk Best Practice Patterns, you can see in this column the beginnings of the section in the book on collections. Once again, I mined the material from the image. Thinking back, I'm amazed at how important reading the image has been to me. I can remember being incredibly frustrated at having to spend all day looking for the method or class that I wanted, but then realizing at the end of the day that I had gotten more accomplished with six hours of reading and ten minutes of typing than I used to accomplish with ten hours of typing.

We may underestimate the value of a shared body of literature (the image) in creating and sustaining the Smalltalk culture. Perhaps that's why the visual “wire-and-fire” front-ends failed to have much impact-there was no corpus of visual code that everyone routinely consulted.

Our previous column focused on enumeration methods and how to use all of them to advantage. This column covers the common collection classes, how they are implemented, when you should use them, and when you should be careful.

COLLECTION CLASSES

ARRAY

Use an Array if you know the size of the collection when you create it and if the indices into the elements (the first argument to at: and at:put:) are consecutive integers between one and the size of the array.

Type
Chapter
Information
Kent Beck's Guide to Better Smalltalk
A Sorted Collection
, pp. 115 - 128
Publisher: Cambridge University Press
Print publication year: 1997

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

  • COLLECTION IDIOMS
  • Kent Beck, First Class Software, Inc.
  • Book: Kent Beck's Guide to Better Smalltalk
  • Online publication: 04 August 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511574979.013
Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

  • COLLECTION IDIOMS
  • Kent Beck, First Class Software, Inc.
  • Book: Kent Beck's Guide to Better Smalltalk
  • Online publication: 04 August 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511574979.013
Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

  • COLLECTION IDIOMS
  • Kent Beck, First Class Software, Inc.
  • Book: Kent Beck's Guide to Better Smalltalk
  • Online publication: 04 August 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511574979.013
Available formats
×