Skip to main content Accessibility help
×
Hostname: page-component-78c5997874-8bhkd Total loading time: 0 Render date: 2024-11-02T20:38:12.354Z Has data issue: false hasContentIssue false

7 - THE DREADED SUPER

Smalltalk Report, June, 1992

Published online by Cambridge University Press:  04 August 2010

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

Summary

This is a bit of work I am particularly proud of. I wrote a little workspace that got me a method list browser on all the methods in the image that use “super” (that in itself was fun). Then I went through them trying to categorize each one. I felt like a real scientist there for a minute- taking samples, making hypotheses, testing them in the “real world.” The result is a “theory of super,” which is much simpler than the language feature (and perhaps not coincidentally quite similar to the “inner” feature of Simula, from which super was derived).

What is it with this super thing, anyway? The pseudo-variable super is a curious wart on the otherwise unblemished Smalltalk language design. Ordinary messages are sufficient to capture composition, conditionals, and looping. The three components of structured programming thus become unified in Smalltalk. Yes, but.…

The exception is super. It means the same object as self, but when you send it a message the difference is revealed. When you send an ordinary message the class of the receiver of the message is examined for an implementation of that message. If one is not found the superclass is searched, then its superclass, and so on until a method is found. Super circumvents normal message lookup. When you send a message to super the search begins in the superclass of the class in which the executing method was found.

Type
Chapter
Information
Kent Beck's Guide to Better Smalltalk
A Sorted Collection
, pp. 81 - 92
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 [email protected] 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.

  • THE DREADED SUPER
  • 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.010
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.

  • THE DREADED SUPER
  • 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.010
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.

  • THE DREADED SUPER
  • 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.010
Available formats
×