COMP 411 Principles of Programming Languages (Spring 2014)

Professor Robert "Corky" Cartwright
Department of Computer Science
Rice University
Houston, Texas, USA
Room 1070, Duncan Hall, MWF 1:00pm - 1:50pm
   

Course Information

Instructors

Professor Robert "Corky" Cartwright
Email: corky.cartwright at gmail dot com
Office: DH 3104
Office Hours: Mondays, 9am–10am
Wednesdays, 9am–10am
Fridays, 9am–10am
By appointment

Teaching Assistants

Zeng, Yingfu
Email: yingfu.zeng@rice.edu
Office: DH 3099
Office Hours: 2pm–3:30pm M, W or by appointment
Wei, Lai
Email: lai.wei@rice.edu
Office: DH 3111
Office Hours: 2pm–3:30pm T, Th or by appointment

Please try to arrive early during the scheduled office hours or let us know that you will be coming to talk to us.

Course Website and Contact Information

Course website: http://www.cs.rice.edu/~javaplt/411/

Course Piazza page: https://piazza.com/rice/spring2014/comp411/home

Email address to reach the entire teaching staff: comp411@rice.edu

Note: The teaching staff email comp411@rice.edu automatically blocks non-Rice email addresses to reduce the amount of spam. If you plan to send emails from a non-Rice email address, please write your name and the email address you want to use on a piece of paper and give it to a TA to unblock the address.

Please check the course Piazza page regularly for announcements. We also recommend posting questions to Piazza rather than emailing the staff directly.

Recommended References

The recommended reference book for this class is:

Another good reference is:

Please also look at the additional references and the language resources on the course website.

Assignments, Exams, and Grading

Overview

The purpose of the homework is to deepen your understanding of the material introduced in class and to prepare you for the exams. The assignments will be posted on course website.

Projects

Generic Java (Java 5/6/7/8) is the only language that is supported by the course staff for use in the assignments in this course. Scala can optionally be used provided the submitted assignments are compatible with the skeleton JUnit test suites that we supply for all assignments. The Scala compiler generates Java byte code and can be coaxed into supporting specified Java interfaces. Scala is very complex and the Java byte code interfaces that it creates are not always the obvious Java equivalents so we do not recommend using Scala. Students who use Scala must take responsibility for ensuring that the interfaces presumed in our skeleton test suites are in fact supported by their submitted programs. For students who do elect to use Scala, we suggest using the DrScala IDE (based on DrJava) linked from the main web page for the course.

Scheme and OCaml are used in many examples given in lecture because they are more concise, but the same abstractions can be expressed equally well in Java. Students are expected to write their programs in the essentially same "mostly functional" style as well-written Scheme or OCaml code. Mostly functional Java programs rarely mutate the fields of objects or classes. A thorough understanding of the composite and visitor design patterns is a prerequisite to writing good solutions in Java. For tutorial guidance on how to write interpreters in Generic Java, see Prof. Cartwright's Notes on Object-Oriented Program Design.

Java 5/6/7/8 is an industrial strength language that supports "programming in the large". If you have taken Comp 211 or 310, then you have already been educated in how to write Java programs in a clean OO style. Java 5/6/7/8 supports generics, the parameterization of classes and methods by type and performs type checking at the level of parameterized types -- eliminating the need for the most common uses of casting in Java. You are expected to use generics wherever they help avoid explicit casting. The Java 5/6/7/8 Development Kit (JDK) can be downloaded from the Java website at Sun Microsystems/Oracle. The current release of Java is Java 7, but the course grading software still uses Java 6. In particular, language estensions added in Java 7 will not be recognized by the grading program. All assignments will be graded based on how they perform using the current releases of Java 6 and DrJava.

The Java programming platform also includes an effective unit testing tool called JUnit which we expect you to use to test your Java programs. This tool is built-in to DrJava. DrJava includes a command on the "File" menu that generates test class templates for you. If you execute the test command by activating the "Test" button.above the Definitions Pane, DrJava will run all open unit test classes. We only support course submission software on CLE@R machines.

We strongly encourage you to use pair programming on these projects, but we realize that scheduling constraints may make pairing impossible at times. Nevertheless, we expect both students on a team to understand every part of the project. Please employ good coding practices and document your programs extensively. Include a README file with your submission that explains how your project functions and how to invoke it. Test your program well! We will usually supply you with some test cases, but you are expected to add more.

Later projects heavily depend on earlier ones. Please make sure your projects are easy to use and extend (that's why good coding practices are important). For the first three projects, we will give you support code for the first project and solutions to the preceding project for the second and third projects. After that, you will have to use your own code.

The projects are due about every one and a half to two weeks. For an up-to-date schedule, please check the course website regularly. The assignments do not involve huge amounts of code, but the concepts behind them can be very deep. Please start early.

If you cannot find a partner, please email one of the teaching assistants or post to Piazza. Groups of more than two students will not be allowed.

Exams

There will be two written take-home exams, one approximately in the middle of the semester, one during the last week of classes.

Grading

Your grade in this course will equally based on your performance on homework assignments and on the exams.

Slip Days and Late Submissions

Each student has seven (7) slip days that can be used for any homework assignments during the semester, exams excluded. An assignment that is submitted up to one day late will be accepted at the cost of one slip day. Similarly, an assignment that is submitted up to two full days late will be accepted at the cost of two slip days. A day consists of 24 hours; weekend days are included.

If a student has no slip days left, late submissions will not be accepted. If there are any extraordinary circumstances, please try to let us know in advance.

Recommendation: Save your slip days until the end of the term when the assignments are longer and more challenging.

Honor Code Policy

You are encouraged to talk with the lecturer, the teaching assistants, and to any classmates that you choose about the homework. Such conversations are to help you understand the lecture material, the homework problem, and possibly even the key idea for the solution. However, you are ultimately responsible for writing your own solutions in cooperation with your partner. You must do all work jointly with your partner; this stipulation includes every line of code. You and your partner are not permitted to copy the solution from another source.

How to Get Help

If you have a general question, please post to the course's Piazza page. We will be monitoring it and by answering questions there, we can help the entire class. Since all students will be receiving your messages, you may also help each other, as long as you keep the Honor Code Policy outlined above in mind.

If your question is of a personal nature or reveales part of the code of your solution, please DO NOT post to Piazza (see Honor Code Policy). Instead, send an email to comp411@rice.edu to reach the entire teaching staff.

Please note that non-Rice email addresses will automatically be blocked from sending to comp411@rice.edu to protect the students and the teaching staff against spam. If you would like to use a non-Rice email address nonetheless, please write your name and the email address you would like to use on a piece of paper and hand it to a member of the teaching staff. We will then unblock that address.

Accomodations for Students with Special Needs

Students with disabilities are encouraged to contact the instructor or the teaching assistants during the first two weeks of class regarding any special needs. Students with disabilities should also contact Disabled Student Services in the Ley Student Center and the Rice Disability Support Services.

What You Should Watch Out For

Solutions in Java are straightforward to write but Java is a very wordy language so they require many more lines of code than the corresponding code in Scheme. For this reason, most code fragments shown in class will be in Scheme.

Start working on the projects early. While they do not involve huge amounts of code, the concepts behind them are very deep. Make sure your approach is correct.

Code well. While we provide solutions for the first 3 assignments, you will inevitably base later projects on code written in earlier assignments. Don't make it a pain to use your code later.in the course.

Test well. There often are intricate usage cases for some language constructs.

Make sure you stay in sync with the lecture material. Come to class and ask questions. You might be able to solve the projects without studying the course lectures, but the exams will get you.

Document your code and use good OO coding style (including the appropriate use of design patterns and Javadoc documentation). We will deduct points for bad style.

You can talk to the instructor, TAs, and even classmates about general concepts. Ultimately, however, you have to write your own solutions. For example, you cannot share code with anyone outside of your programming pair. This is not the only rule, it was just an example. If in doubt, ask first!

For the projects, you'll have to work in pairs and do pair programming for every part. Both partners have to know how each part of the program works.

Back to course website