CSE 130: Programming Languages-Principles and Paradigms

Spring 2002


The final exam will be on Monday June 10, from 7pm to 10pm, in class (Center Hall room 119).  You may bring and use the following materials: your own personal hand-written notes, and a printed copy of the published lecture and section notes.  You may not bring any books or any other materials.

The third assignment is now available.  This is a team project, with due date Friday May 24.

The second assignment is now available.  This is a team project, with due date Wednesday May 8 (an extension of one week).  Here is a handout on the basics of usng ML that you will find useful.  Useful sections from the book Elements of ML Programming (ML97 Edition) are available online as UCSD e-reserves.

The first assignment is now available.  The submission deadline is in class on Monday April 15.  Here are the submission instructions.


CSE 130 is a survey of the main features, fundamental concepts, and similarities and differences of the most important modern programming languages.  The principal languages considered are C, Java, Pascal, Ada, and ML, but the focus is on programming languages in general, not on the details of specific languages.  We may also use PHP and/or Prolog.

The CSE 130 section id is 434172.  Although CSE 100 is a prereq, the instructor will sign "add cards" for students who show proof that they are concurrently enrolled in CSE 100.  CSE 130 is expected to be offered again in Fall 2002.

This offering of CSE 130 will resemble the Fall 1999 version of the course.  Follow the link for lecture notes, old assignments and exams, etc.  Please ask all questions on the Discus web-based discussion board, except for private ones.


Name Email Telephone Office Hours Office Location
Charles Elkan  elkan@cs 534-8897 Mon, Wed 4pm to 5pm AP&M 4856
Joe Drish  jdrish@cs Mon, Wed 10am to 11am AP&M 3337A
Greg Hamerly  ghamerly@cs Tuesday, Thursday 5pm to 6pm AP&M 3349D

If you are unable to attend office hours, feel free to send email to arrange an appointment.  Office hours will begin on Wednesday, April 1.  Times are subject to change

We have a Discus web-based discussion board.  Please ask all questions here, except for private ones.


Lecture notes for each Monday and Wednesday class meeting will be published here on the class web page, which will be found at  If you want to read ahead, see the old lecture notes from the Fall 1999 version of the course.
date topics
April 1 Course overview, important historical PLs.
April 3 Values and types.  Enumeration types, primitive vs. composite types, Cartesian products.
April 8 Mappings: finite, infinite, partial, total.  Arrays, functions as mappings.  First-class values, higher-order functions.
April 10 Introduction to ML, type inference, higher-order functions in ML, equivalence of (A->B)->C and (AxB)-> C.
April 15 Union types, recursive types.
April 17 Lists in ML, representing symbolic expressions in ML.
April 22 Abstract syntax, expressions, definitions, and commands, environments.
April 24 Locations vs. values, binding vs. applied appearances, static (nested block-structured) vs. dynamic scoping.
April 29 Similarity between dynamic scoping and assignment.  Lifetimes, stack vs. heap variables, persistent and "own" variables.
May 1 Abstract types (ADTs): specification and implementation parts, information-hiding.
May 6 ADTs: public vs. private, pure vs. updatable, packages.
May 8 Object-oriented programming as an extension of imperative programming.
May 13 Inheritance, dynamic binding of method names. 
May 15 Language mechanisms to handle exceptions.
May 20 In-class midterm.
May 22 Structural and name type equivalence.  Expressions and literals.
May 29 Aggregates.  Evaluation order, conditional expressions.  Functions as abstractions, formal vs. actual parameters.
June 3 Semantics of parameter-passing: call by value, by reference, by macro.
June 5  Call-by-macro vs. by environment.  High-level concurrent programming: tasks and rendezvous in Ada.



We will use one textbook, Comparative Programming Languages by Leslie B. Wilson and Robert G. Clark (third edition, 2000).  (The link to Amazon here is for information only.  You are free to buy books anywhere and the course staff have no connection with any bookseller.  The book should be available in the UCSD bookstore, and it can be purchased easily over the Internet.)  The textbook is "required" so you must have your own copy.

The other "required" text for CSE 130 is the instructor's online lecture notes.   If you want to read ahead, see the old lecture notes from the Fall 1999 version of the course.  This quarter's lecture notes will be similar, but some material will be changed and some will be added.  Some topics discussed in class will not be in the textbook, or will be explained differently. Coming to lectures and taking notes carefully is important.

The book Elements of ML Programming (ML97 Edition) will also be useful.  This book is on reserve at the S&E Library, and important sections will also be available online as UCSD e-reserves.  It is easy to buy on the web.

As the quarter progresses, it is your responsibility to locate relevant chapters of the textbook and to study them.  Use the index of the book!  Examinations will be based mainly on the online lecture notes, but may ask questions that involve knowledge in the textbook.


Lectures are on Mondays and Wednesdays from 6:50pm to 8:10pm in Center Hall, room 119.  The first lecture will be on Monday April 1, 2002. Lectures will start and end on time, so students should not arrive late.

One section meeting is scheduled each week, on Fridays from 9:05am to 9:55am in Peterson Hall, room 110.  The first section meeting will be on Friday April 5.  Attendance each week is required.

There will be four project assignments, each to be done in a team.

The midterm will be on May 20, in class.  It is intended mainly as practice for the final exam, which will be on Monday June 10, from 7pm to 10pm.  Here are sample answers for the Fall 1999 midterm.  Here are the guidelines used for grading.


The midterm exam and the final exam will be "closed-book." However for each exam you may use one double-sided sheet of notes in your own handwriting.  You may not use books, or printed or typed notes, or notes written by someone else.

The midterm will count for 1/6 of your overall grade and the final for 1/3.  Assignments and projects will count for 1/2 of your overall grade.  Your grade will therefore be based at least 1/2 on your individual work, as reflected in the exams.

Grading will not be based on arbitrary numerical standards, nor will there be a fixed "curve." There is no fixed correspondence between letter grades and numerical scores on the assignments or on the exams.  You can evaluate your performance in the class by comparing your scores with the means and standard deviations, which will be announced.  However there is also no fixed correspondence between letter grades and standard deviations above or below the mean.  If all students do well in the absolute and compared to previous years, then all students will get a good grade.

You should not drop CSE 130 just because you are unhappy with the score that you receive on the midterm or on a project or assignment.  Instead, you should make an appointment to discuss with the instructor or with a TA how you can do better on the final and on following projects.

The description of each team project will be distributed in class on a Wednesday.  Project reports will be due on the Friday that is two weeks and two days later, before 6pm.  Projects will be graded out of 20 points.  Reports submitted on the Monday after the due date will lose five points.  Each extra day late will lose another two points.


Complete academic honesty is required.

For each team project you must be part of a team of exactly three students. Each team must hand in a single project report.  For each project, the three members of a team will all receive the same score.  It is your responsibility to find good project partners.  You may stay with the same team for all projects, or switch after one project and before the next.  You may not switch halfway through a project.

Part of the purpose of the team projects is to help you develop your ability to work well with other people.  To help you learn from each project, each team should staple a single copy of this team self-evaluation form to each project report.  Your team should discuss the questions on this form before starting each project.  At the end of each project, you should write consensus answers to the questions on the form.

The first assignment will use C and Pascal, the second will use C and ML, the third will use C++ and Ada, and the last will use Java and PHP. It is your responsibility to learn the details of how to use these languages for the assignments.  We will discuss the most important features and differences of these languages in class, and there will be introductory handouts.

UCSD labs with Unix workstations are available for you to use, in particular the uAPE lab in AP&M room B402.  All software for CSE 130 will be installed on the ieng9 Sun server.  You may do the assignments using other computers, but you should make sure that your programs compile and execute correctly on ieng9.  We will use some version of the ACS turnin  utility to check that your programs are correct.  There will be future instructions on this.

The UCSD Unix labs are overcrowded.  You are encouraged to install Linux or some other free version of Unix on a home computer and to use that for most of your software development.  Note that Linux runs well even on the oldest 75 MHz Pentium personal computer, and that you can have Linux and Windows on the same computer, so you do not need to buy a new computer in order to have Unix at home.


The single report submitted by each team should be well-organized and well-written.  Reports should be as long as necessary to be complete and easy to read, but they should be concise.  The maximum length permitted is six pages, single-spaced.

Transcripts should show sample inputs and the corresponding correct outputs produced by your programs.  Under Unix, the tee command is useful for producing transcripts.

Your report and all attachments (if any) should be printed on standard 8.5 inch by 11 inch paper using a laser printer or a high-quality inkjet printer.  You should use text processing software such as Microsoft Word, which is available on UCSD Macintosh computers for free student use.  Each report and any attachments appendices should be stapled together securely.  Reports assembled with paper clips or other insecure bindings will be rejected.  Do not use any plastic or cardboard binders or sleeves.


Organize your report clearly, with sections, subsections, and paragraphs.  Each section and subsection should have a title that is informative about what the section or subsection contains.

Use diagrams, charts, and tables when useful.  Always provide labels and legends.

Follow all the rules of good writing explained by Strunk and White (see below).

If you refer to sources such as the textbooks for the course, do not just give a general bibliography.  Instead, cite the sources you use in the body of your report at each location where a source is relevant.  Give full bibliographic information in a "List of References" at the end of the report, not in footnotes.

The main part of a report should not include raw printouts.  Instead, each report should have two appendices, which are not counted in the ten-page length limit.  The first appendix should be a printout of the programs written by your team for the assignment (i.e. listings), and the second appendix should be a printout of sample executions of your programs (i.e. a transcript).


If you are not confident that you know how to write good technical papers, then you should seek help and advice.  The CSE 130 instructor and teaching assistants are available to assist you.  However you should also use other resources.  In particular you should use the UCSD Office of Academic Support and Instructional Services for help with writing.  According to their web page:
"The Writing Center offers the UCSD community FREE one-to-one conferences on any kind of writing project ... Various workshops are offered, including ... essay writing ... The OASIS writing test assesses your strengths and weaknesses in writing and editing academic papers. ... Individual tutorial services are available to students whose first language is not English."
The OASIS Writing Center is located in Center Hall. Call 534-3760 to make an appointment.


The best book on the basics of good writing is The Elements of Style by William Strunk Jr. and E. B. White, Macmillan, New York, third edition, 1979. The full text of the 1918 edition is out of copyright and available online.

The following report contains everything that a computer scientist needs to know about technical writing. Although the report is protected by copyright law, it is available for viewing on the web.

Technical Writing for Computer Engineers and Computer Scientists by Kevin Karplus and Dan Scripture.

From the report: "This document contains course notes and exercises for a course in technical writing. The course is intended for third-year computer engineering majors, and emphasizes technical documentation directed to engineers, engineering managers, technical writers, and other specialized audiences. Exercises include job applications and résumés, memos, electronic correspondence, algorithm description, in-program documentation, naive-user documentation, survey articles, recommendation letters, proposal writing, document specification, progress reports, formal technical reports, and an oral presentation."
After you have mastered the mechanics of writing, the next challenge is to develop a sense of style.  The book Clear and Simple as the Truth: Writing Classic Prose by Francis-Noel Thomas and Mark Turner is a wonderful treatise on the topic of writing style.  Be sure to explore the authors' online guide to good writing.


Full implementations of the ML language and of PHP are available free for Linux, Windows, and many other operating systems.

How to Write Unmaintainable Code by Roedy Green.

Last updated on June 5, 2002 by Charles Elkan,