Princeton University
Computer Science Dept.

COS 333: Advanced Programming Techniques

Spring 2019

Brian Kernighan

Christopher Moretti

Tue May 14 05:56:37 EDT 2019


Thanks to all for some great demos. More than a few of our visitors have told me how impressed they were with your work and the presentations.

Now all that's left is to submit your project by Sunday evening, as described here:

Demo and submission information
Note that this includes written material, and must include working links to your project, which we must have for grading.

Peer evaluations must be uploaded by Dean's Date; details here

Laptop Policy:

Reminder: Laptops, phones and tablets are not permitted except for taking notes and other class purposes. Regrettably, computers and phones appear to be primarily used for email, chat, YouTube, Twitter, Google, solitaire, poker, eBay, Facebook, Instagram, Snapchat, COS 340 homework, and similarly compelling diversions, all of which distract you, your neighbors, and me. (Additions to this list are welcome; I can't keep up.) This paper by Clay Shirky makes the case for banning distractors, as does this New York Times article.

Lecture notes:    2/5    2/7    2/12-14    2/19    2/21    2/26    2/28    3/5    3/7    3/12    3/14    3/26    4/2    4/11    4/16    4/18    4/23    4/30    5/2   

Assignments:    1         2         3         4        

Project:    preliminary description     previous projects     comments from previous projects     Project ideas from across campus     Design document specification     Project groups, with TA assignments     The Mother of All Demos     GeoTasker movie (May, 2014)     Final demo schedule    

Readings:    general bibliography     language tutorials    

Old stuff:    Piazza     playlist     Hacker News tools thread     survey     Another HN tools thread     web2 wordlist     How SQLite3 is tested     SQL injection attacks     > CAS authentication code     Andrew Ko book on UI     UI suggestions     Optical telegraph     Ken Thompson ...

Dates:    Dates are subject to minor changes.

	Su Mo Tu We Th Fr Sa
Feb	                1  2
	 3  4  5  6  7  8  9	first class
	10 11 12 13 14 15 16	assignment 1 due
	17 18 19 20 21 22 23	assignment 2 due
	24 25 26 27 28		assignment 3 due
Mar	                1  2	team meetings with bwk by 3/1 
	 3  4  5  6  7  8  9	assignment 4 due
	10 11 12 13 14 15 16	design document due
	17 18 19 20 21 22 23	spring break
	24 25 26 27 28 29 30	weekly TA project meetings start
Apr	    1  2  3  4  5  6
	 7  8  9 10 11 12 13	project prototype
	14 15 16 17 18 19 20
	21 22 23 24 25 26 27	alpha test
	28 29 30
May	          1  2  3  4	last class; beta test
	 5  6  7  8  9 10 11	project demos on Wednesday
	12 13 14 15 16 17 18	projects due Sunday
	19 20 21 22 23 24 25
	26 27 28 29 30 31

Course Summary:

This is a course about the practice of programming, an attempt to expose students to the development of real programs. Programming is more than just writing code. Programmers must also assess tradeoffs, choose among design alternatives, debug and test, improve performance, and maintain software written by themselves and others. At the same time, they must be concerned with compatibility, robustness, and reliability, while meeting specifications. Students will have the opportunity to develop these skills by working on their own code and in group projects.

During the first part of the semester, there will be four programming assignments, each of which should take perhaps 5-6 hours to complete. Thereafter, students will work in groups of 3 to 5 on a project that will involve a substantial amount of design and implementation.

COS 333 is about programming, not about any specific language. The course will assume that you are very familiar with C and Java, and will include excursions into a variety of languages like shells, Awk, Python, Javascript, C++ and Go. There will be significant emphasis on tools, both how to use them and how they are designed and built. Students must be comfortable with C and Java programming and with Unix, and able to write modest-sized programs that work. COS 217 and 226 are prerequisites.


This syllabus is always subject to change. Each topic will take roughly one week; there's no guarantee that we will cover all of them, nor in any particular order.

This is meant to be more than a laundry list, however. Each section will also discuss issues of design, implementation, testing, performance, portability, and other software engineering concerns, and these will also be part of the programming assignments. With luck there will be a handful of guest lecturers as well.

There is one required text: The Practice of Programming, by Kernighan and Pike; you should also know basic Unix tools and usage as described in, for example, The Unix Programming Environment. Other readings will be posted. The books listed in this bibliography are also worth looking at; they cover a wide variety of material related to programming.

    Tuesday and Thursday 11:00-12:20, Bowen 222

    Brian Kernighan,     311 CS, bwk at
    Christopher Moretti     Corwin Hall, cmoretti at

Teaching Assistants:
    Allison Chang '18 (archang)
    Lance Goodridge '17 (lanceg)
    Jace Lu (yinjil)

Office hours until midterms:

Allison		3:30-5:30 M, 3:30-4:30 W in Friend 003
Jace		5:00-6:30 TTh in Friend 010
Lance		5:00-8:00 W in Friend 010
Christopher	2:00-3:30 T, 12:30-2:00 Th in Corwin 036
Brian 		1:30-3:00 W in CS 311


Four programming exercises will be assigned during the first half of the term; each is intended to take about 5-6 hours, but is sure to take longer unless you are careful.

Assignments are together worth about 35 percent of the course grade. Assignments will be posted on Mondays and due by 10:00 PM on the Thursday of the following week. This leaves enough time that we will not be able to grant extensions except in case of documented medical or other serious issues. For the record, extracurricular activities, interview trips and heavy workloads in other classes don't affect the lateness rules for this class.

If you submit your work late, we will give you credit for it on this scale:


The second half of the semester will be devoted to a group project. The project can be done with whatever combination of languages and techniques makes most sense; one of the goals of the project is to encourage careful tradeoffs among alternatives, and planning of interfaces to minimize dependencies among components. The project is a good place to explore personal interests further than can reasonably be covered in class.

The project will have frequent checkpoints along the way for which you will have to prepare status reports, preliminary designs, and the like. There will be a public presentation and demo at the end, a written writeup, and submission of your system for testing and evaluation. All of these are graded.

The project will be worth about 65 percent of the course grade; it will be shared equally among group members, with the possibility of negative adjustments for members who fail to contribute their fair share.

You must complete all assignments and all project requirements to pass the course. Furthermore, the class is large enough that we don't have the resources to nag and make special arrangements; you are responsible for meeting all the requirements without reminders.


Attendance and participation is potentially worth up to 10 percent of the course grade.

Regular class attendance is required and class participation helps. Unexcused absences are grounds for a failing grade regardless of other performance. This means you.

Laptop Policy

Please, no laptops, phones or tablets except for taking notes and other class purposes. Regrettably, computers and phones appear to be primarily used for email, Instagram, Snapchat, YouTube, Twitter, Google, solitaire, poker, eBay, Facebook, and myriad other similarly compelling diversions, all of which distract you, your neighbors, and me. (Additions to this list are welcome; I can't keep up.) Sorry, but laptops, etc., are not permitted in the class except for class purposes.

Collaboration Policy for Assignments:

(This policy on collaboration in assignments is adapted from the COS 217 web page.) Programming, like composition, is an individual creative process. Individuals must reach their own understanding of the problem and discover a path to its solution, and unlike physics or math problem sets, there may be no single right answer. During your development, you are encouraged to ask your friends and the course staff about assignment ambiguities, language and operating system features, terminology, and so on. The course Piazza page is also useful for this. However, when the time comes to write the assignment-specific code that solves the problem, discussions with classmates are no longer appropriate. You may get help only from the course staff in the process of designing or writing code, not from other students.

Do not, under any circumstances, copy another person's program for an assignment, including any part of another person's program -- broadly defined to include operative code, comment outline, logic flow diagrams, pseudocode, etc. This prohibition also includes any solutions from any previous offering of this course, any solutions to similar assignments from elsewhere, or any information gained from improper discussion or collaboration. Further, note that the University's academic regulations work in both direcitons: writing a solution for use by another person and using another person's work in any form both constitute violations. If you plan to do something that you are not absolutely sure is permitted, ask first. Ignorance of this policy will not be accepted as an excuse for your actions. See the academic regulations.

Examples of unacceptable behavior for assignments include:

The program you turn in must be your work. You may get help from the instructor or a TA after you have started writing code, but not from other students. Each student is expected to come up with his or her own individual solution.

You are responsible for ensuring that your files are not readable by your classmates. We recommend doing your COS 333 assignments on your own computer or in a private subdirectory, i.e.:

	% mkdir cos333
	% chmod 700 cos333

Collaboration Policy for Projects:

Projects will often use open source code and other publicly available material as building blocks or as the basis for modification and adaptation. This is permitted and indeed encouraged, but such code must be properly attributed, and the project as a whole must be substantially your own work. Please consult with the instructors if you are uncertain about a proposed course of action.

Project groups are encouraged to share insights and information about how things work, how to get things done, and other aspects of programming knowledge. If you have code or expertise that will help others do their projects better, you are encouraged to share it.