CS655: Programming Languages, Spring 2001 |
Manifest: Tuesday 20 March 2001
Assignments Tuesday, 26 March Project Proposal Readings
Read before Thursday's class (handed out today):
- Bjarne Stroustrup. What is "Object-Oriented Programming"?. Proceedings of the First European Software Festival, 1991 revised version.
The object of reading this paper is for you to think objectively about whether or not you object to Stroustrup's possibly objectionable definition of object-oriented programming. Read his section 3 with a critical eye - how many of his complaints about data abstraction facilities are solved by languages with good support for data abstraction (such as CLU)? Does his definition of an abstract type (he prefers "user-defined type") bely a prejudice or a lack of understanding? His description of an exception mechanism that resembles the ones found in Clu (sic) either is incorrect or assumes a very loose definition of resembles.You should be able to find at least two bugs or serious deficiencies in his example programs. (Despite all these flaws, its a good paper summarizing the language features that enable object-oriented programming.)
- Daniel Ingalls. Design Principles Behind Smalltalk. BYTE Magazine, August 1981.
This paper presents a starkly different view of what object-oriented programming is all about from the Stroustrup paper. Twenty years later, typical programmers are still using languages far further from natural thought processes than Smalltalk-80. How do you think the Smalltalk designers think about their Natural Selection property today?Read before next Tuesday (handed out today):
- Barbara Liskov and Jeannette Wing. Behavioral Subtyping Using Invariants and Constraints. CMU-CS-99-156 (based on November 1994 ACM TOPLAS paper.)
A challenging, but worthwhile paper. As you read it, attempt to relate their rules for subtyping to the programming problem they are trying to solve: making programs written without knowledge of all possible subtypes work as expected with new subtypes.Questions
- What is data abstraction?
- What programming language mechanisms are necessary to support data abstraction?
- How to reason about data abstraction implementations using Abstraction Functions and Rep Invariants.
- What is rep exposure?
Open here I flung the next book, when for inheritance I looked,
I found only interfaces, ‘multiple’ and nothing more;
Not the least attempt was made here, to reuse code from year to year;
But, with a Java interface, you seem to accomplish more—
Howe’er each method must be unique written o’er and o’er and o’er –
Once per reuse, sometimes more.
...
Wondering ‘bout the standard classes used so by the coding masses,
"Doubtless," said I, "what vectors need, objects alone they can explore
Primitives must use a wrapper avoiding a sure disaster,
Objects the primitives become, not ints or floats anymore
Complex objects they have become, primitives they are no more –
Simple items, Nevermore!"
...
"Java!" said I, "thing of evil! – deceiving coders even still! –
Claim to pass-by-value instead pass-by-reference evermore,
Primitives alone get copied, object references you do need –
Changes you really make indeed, changed the value evermore —
Is there – a way to avoid this? – tell me – tell me, I implore!"
Changes made for evermore."Java!" said I, "thing of evil! – arrays are objects even still! –
Arrays are a predefined class, a class themselves nothing more –
I wish I could use them easily, like in C, oh so feasibly,
Unfortunately, you will see, much overhead must be bore,
For the weight of using classes, is substantial as before."
Weight of classes, evermore."Be this word our word of parting, multi-dimmed arrays are starting,
To be more than what they are worth, worth their name and nothing more.
Overhead of array-arrays, despite its glory far out-weighs,
Any usefulness in making multi-dims for evermore.
Since they’re objects they can’t start to be efficient evermore.
Shall be lifted – nevermore!And then Java, one last feature, wasting moments, like a creature,
Living in the deepest sewer, suddenly appears before,
You try some intense mathematics, wasting time you know the clock ticks,
And the mem’ry fin’lly is free, you can go on as before,
Knowing Java’s complete control, cannot turn it off e’ermore,
Ran the garbage collector.
Excerpted from Dana Wortman, Sun’s Java (based loosely on Edgar Allen Poe’s The Raven) (See http://www.cs.virginia.edu/~evans/cs655/problem-sets/ps3-raven.html for full poem.)
University of Virginia Department of Computer Science CS 655: Programming Languages |
David Evans evans@virginia.edu |