• Login
    View Item 
    •   MINDS@UW Home
    • MINDS@UW Madison
    • College of Letters and Science, University of Wisconsin–Madison
    • Department of Computer Sciences, UW-Madison
    • CS Technical Reports
    • View Item
    •   MINDS@UW Home
    • MINDS@UW Madison
    • College of Letters and Science, University of Wisconsin–Madison
    • Department of Computer Sciences, UW-Madison
    • CS Technical Reports
    • View Item
    JavaScript is disabled for your browser. Some features of this site may not work without it.

    Code Sandwiches

    Thumbnail
    File(s)
    TR1647.pdf (270.1Kb)
    Date
    2008
    Author
    Elder, Matt
    Jackson, Steve
    Liblit, Ben
    Publisher
    University of Wisconsin-Madison Department of Computer Sciences
    Metadata
    Show full item record
    Abstract
    A code sandwich consists of before, after, and body code. Typically, the before code makes some change, the body code works in the context of the change, and the after code undoes the change. A code sandwich must guarantee that its after code will execute if its before code has executed, even if exceptions arise. This pattern is common to many programming situations, and most modern languages have some language-level support for expressing it. We survey support for code sandwiches in several programming languages and proposed language extensions. We explain why such support can improve a program, consider related features, and discuss desirable properties that a language can provide its programmers. We relate these properties to Jyro, our code sandwich extension to Java. We examine two large, mature open-source programs, find numerous sandwich-related bugs and readability issues, and demonstrate how they might be avoided using our Jyro implementation.
    Permanent Link
    http://digital.library.wisc.edu/1793/60658
    Type
    Technical Report
    Citation
    TR1647
    Part of
    • CS Technical Reports

    Contact Us | Send Feedback
     

     

    Browse

    All of MINDS@UWCommunities & CollectionsBy Issue DateAuthorsTitlesSubjectsThis CollectionBy Issue DateAuthorsTitlesSubjects

    My Account

    Login

    Contact Us | Send Feedback