Sign in or register
for additional privileges

Border Codes

Mark Marino, Author

You appear to be using an older verion of Internet Explorer. For the best experience please upgrade your IE version or switch to a another web browser.

Annotating Code -- The Code in Action


This type of annotation helps readers understand the particular effects of a line of code.

Source code is a medium for the programmer to conceptualize and interact with the operations of software.  In order to test the validity of the code, prior to run time, the programmer attempts to anticipate the effects of the code, the way the instructions will be processed, abstracting out the functioning from the process of translation if the code is compiled.  In other words, the programmer trusts the compiler much the way a person might plan a trip without worrying about the reliability of the airplane she is taking.   The programmer, out of necessity, operates at various levels of abstraction, specifically, in this case, that which Abelson and Sussman call "Black-Box abstraction."

In order to bring that experience to readers, one type of annotation juxtaposes the line of code with its effect in the software.  For example, a line that displays output on the screen can be juxtaposed with images (verbal or pictorial) or video of a screen displaying that image. 

Of course, this juxtaposition also involves a certain amount of abstraction, or metonymy, as one instance of the code in operation on a particular machine comes to stand in for the general functioning of that code on any machine.  Furthermore, the effect displayed represents just one set of consequences once that line is processed.  It does not display, for example, changes within, say, memory locations or effects on memory locations, which if not shown could be described or modeled.  Finally, rarely does one line of code create an effect by itself out of the context of the entire body of code in the software.

[Example of annotating the code with examples of run-time effects]
Comment on this page
 

Discussion of "Annotating Code -- The Code in Action"

Add your voice to this discussion.

Checking your signed in status ...

Previous page on path Typology of Annotations, page 2 of 5 Next page on path