Course Info

This page contains the syllabus for CS 164.

Course personnel:

 NameOfficePhoneEmailOffice Hours
InstructorKoushik Sen567 Soda642-2420ksen at cs.berkeley.eduThur 3-4 pm
T.A.Wontae Choi562B Soda650-339-8190wtchoi at berkeley.eduTue 11am-12pm
T.A.(Peter) Xi Chen283E Soda    510-367-5454c.xi at berkeley.eduFri 10:00-11:00am

Please attach prefix [cs164] to the title of emails.

Time and Place:

Lectures1Mon-Wed 10:30-12:00306 Soda HallSen
Discussion Sections101Wed 3:00-4:00285 Cory HallChen
102Wed 4:00-5:003105 EtcheverryChen
103Thu 11:00-12:0085 EvansChoi
104Thu 2:00-3:00320 SodaChoi

The TAs' section notes are available here.

Course description:

CS 164 is designed to acquaint students with the design and implementation of high-level programming languages. The course consists of a theoretical component, which stresses general underlying concepts, and a practical component, which consists of a significant course project. Students are expected to write the project in Java.

Course prerequisites:

CS 61A, CS 61B, and CS 61C or equivalent. Also required is the ability to program in Java on a UNIX system.

Tentative Syllabus & Schedule of Assignments


RecommendedA. Aho , R. Sethi , and J. D. Ullman , " Compilers: Principles, Techniques, and Tools ", 1st edition, Addison-Wesley, 1986. You can also use the second edition.
RecommendedJLex , Java Cup, and Spim .  
Andrew Appel , "Modern Compiler Implementation in Java". It is optional but helpful reading.

Copies of the lecture notes will also be made available on the course home page. 

Another book you might find useful is " Unix in a Nutshell (System V Edition) " by Gilly , published by O'Reilly & Associates. As its name suggests, the book is a short guide to working on a Unix system, including descriptions of common Unix commands and utilities. 

Written Assignments:

Most weeks there will be a written assignment covering material presented in lecture and the readings. The written assignments are to be completed individually. Written assignments will be graded on a simple credit/no credit basis and will not be weighted heavily; the purpose of the assignments is to give you practice with the theoretical material of the course. Spending time on the written assignments pays off on the exams. 

Written assignments are due by 10:30 a.m. on the date in the course schedule. Write your name, email address, and section on your assignment. Assignments may be turned in class (before the lecture).

Please do not bring assignments to staff offices.


The course project consists of five programming assignments. Taken together, the five assignments form a complete implementation of Cool, the Classroom Object Oriented Language

Start the programming assignments early! Completing the course project is a large, complex, and rewarding task, which is made much easier by giving adequate forethought to design. The course schedule allows ample time to complete the assignments---take advantage of it. The project components are assigned in roughly increasing order of size and difficulty; proportionately more time is allotted for the later assignments. Later assignments will be weighted more heavily in the final grade. Programs will be evaluated for correctness, organization, and documentation. 

Documentation and structuring should be incorporated into programs from the beginning. Neither the instructors, teaching assistants, or readers will help with incomprehensible programs. 

Programming assignments may be done individually or in teams of two. (The first programming assignment will be done individually, however.) Teamwork imposes burdens of communication and coordination, but has the benefits of more thoughtful designs and cleaner programs. Team programming is also the norm in the professional world.

Students on a team are expected to participate equally in the effort and to be thoroughly familiar with all aspects of the joint work. Both members bear full responsibility for the completion of assignments. Partners turn in one solution for each programming assignment; each member receives the same grade for the assignment. If a partnership is not going well, the teaching assistants will help to negotiate new partnerships. Teams may not be dissolved in the middle of an assignment.

Programming assignments are due at 11:59 p.m. on the date in the course schedule. Programming assignments will be turned in electronically; the exact method will be announced with the first assignment. All programming will be done in Java on workstations in Cory and Soda Halls using your individual accounts.

Late Policy:

Each student gets an automatic extension of 96 hours. You can use the extension on any programming assignment(s) during the semester (in increments that are rounded up to the nearest integer). For instance, you can hand in one assignment 96 hours late, or each of four assignments 24 hours late. For group project assignments, the slip time will be deducted from each team member's remaining slip time. When you hand in a late assignment, you must identify in the README file the following: (i) how late this assignment is, and (ii) how much of the total slip time you have left. No assignment will be accepted more then 96 hours late. After you have used up your slip time, any assignment handed in late will be marked off 1% per hour. This policy does not apply to the written assignments.

There is a 1% penalty for each hour, or partial hour, that a programming assignment is late. That is if you turn in the programming assignment at 8am the next day (i.e. 8 hours late) your grade for that assignment will be multiplied by a factor of 0.92. 

Late written assignments will receive no credit. 


There will be two midterm examinations and a final. The midterms will be held in class on March 3 and April 7.  

The final exam is scheduled for 5/13/14 at 3-6PM (final exam group 7). 

There will be no early or make-up exams. Please plan accordingly!

Regrade Policy:

Regrade requests will only be accepted for programming assignments and exams. In either case, all regrade requests must be received within one week upon receiving your score. For exams, we will only consider regrades if we made a mistake in the grading of your exam. Note that we reserve the right to regrade the entire exam. For programming assignments, we will only consider regrades if we made a mistake in the grading of your project or if there was a small bug in your project that caused you to lose at least 10 points. A small bug is one that can be fixed by changing very few lines of code without affecting the design or the algorithm in a significant way. All such requests must be made to your TA (not to the readers). If we accept the regrade request we will re-run the autograder and will give you 50% of the score difference.

Discussion Sections:

Students are expected to attend discussion sections. Relevant material, especially the details of the programming assignments and software tools, will be covered only in discussion sections.


It is impossible to pass the course without doing the programming assignments. The relative weight of the components of your grade will be approximately:

Written assignments5%
Course project I3%
Course project II7%
Course project III7%
Course project IV11%
Course project V12%

Midterm I15%
Midterm II15%

It is expected that all students understand University policies on academic honesty. Cheating on assignments or exams is very serious and will not be tolerated. In this course, we will use a variation of the standard policy. In this class, it is permissible to talk to other students about assignments, to discuss particular solutions, and even to receive partial solutions (including code) from others. However, all assistance and cooperation must be cited in the assignment write-up . If you receive any assistance from anyone other than course staff or your partner on an assignment, you must acknowledge in the write-up for that assignment who gave assistance and what assistance was given. Grading will take into account how much help a student received from others (the more help, the lower the grade). Failure to acknowledge sources is plagiarism and will be treated as a serious breach of academic honesty. No assistance may be given or received on exams. 

You should know that fairly sophisticated plagiarism detection software will be used on the programming assignments.


Handouts will be available on-line on the class home page. 


The material presented in class will correspond roughly but not exactly to the material covered in the readings. The assigned readings for the latter part of the course are tentative.

Home Page and Newsgroup:

The class home page for this semester is All course handouts, answers to frequently asked questions, lecture notes, and updates on assignments will be posted. The class forum is