CMPT 127 - Computing Laboratory

Instructor: Richard Vaughan

How to get help


  • 5 Jan: site posted.

Schedule - Spring 2018

Lab submission schedule to be discussed in class before being published here.

Labs are held in CSIL's main room (ASB 9838) at these times:

  1. D100 Tues 09:30 - 12:20
  2. D200 Tues 12:30 - 15:20
  3. D300 Tues 15:30 - 16:20

Vaughan and two TAs are available in lab hours.

TAs are also available in CSIL 9838 or 9840 at the times shown on the calendar below. The calendar also shows holidays, reading break, etc.

TA times are TBD and will appear here soon.

Instructor office hours:

  • None. See me in the lab or by appointment (email requests).


This class will teach you the basics of programming in C and C++, with an emphasis on program design and testing. We will use the standard UNIX command-line build and version control tools.

The class is intended to be taken simultaneously with CMPT 125, and the material is closely synchronized.

Why C?

More than most modern languages, learning C helps/forces you to understand how the computer and operating system works. C was designed as a system-programming language, so it is small, works everywhere, and (when well-written) can be very high-performance. However, it is very easy to write bugs in C code. You will learn strategies for testing and debugging, but most of all we will discuss approaches for writing correct and well-designed code in the first place. You can learn C in a semester, but becoming expert takes longer.

Assignments == lab tasks

This class consists of ten labs plus a simple warmup Lab 0. Labs are issued to you every tuesday starting from Week 2 of the semester. Each lab contains several tasks, small assignments that are submitted individually.

You submit your code solutions to an online version control system, and they are automatically tested. You may submit solutions at any time, and you may make multiple attempts.

Lab tasks before the midnight following the last day of classes, that is, your entire repo at the moment of the deadline will be graded.

This means that:

  • You can commit code at any time, as many times as you wish, before the deadline.
  • The only version that gets graded is the one that exits at the deadline.
  • Each task has equal weight and there is no penalty for skipping one beyond the obvious loss of credit for that task.


Your grade will depend on how many tasks you solve correctly. The tasks are currently being revised and a grading scheme will be published here soon.



  1. Beginners guide to using the Linux terminal
  2. CS Undergrad Labs (CSIL) Information
  3. A concise introduction to C by Nick Parlante of Stanford. See also their nice library of related topics.
  4. Richard Feinman on what computers are doing.
  5. MIT 6.00 Intro to Computer Science by Grimson and Guttag (examples in Python but CS ideas are universal).
  6. Harvard CS50 CS 1 by Malan (examples in several languages including C).

Procedure for getting help:

  1. Read the instructions through very carefully.
  2. Think about the instructions.
  3. Repeat steps 1 and 2.
  4. Google it. Practice formulating questions as searches: this is an incredibly useful skill. Experts do this.
  5. Ask an instructor or TA in the lab
  6. Read these notes on getting help by email, then send email to
  7. Do not mail the instructor directly, except about personal matters.


Restricted to enrolled students. Labs are set weekly, and content may change up to a lab's release day.

  1. Getting Started in CSIL
  2. Getting Started in C
  3. Functions and Arrays
  4. Dynamic memory allocation
  6. Composite Data Types
  7. File I/O
  8. Testing and Lists (OPTIONAL - NOT FOR CREDIT)
  9. Memory allocation performance
  10. Interactive, event driven applications
  11. (labs will appear here week-by-week)

NASA's Mars Science Laboratory "Curiosity", currently running 2.5M lines of C on a RAD750 CPU on Mars. NASA has very strict and interesting coding standards that help them create highly reliable software.

Margaret Hamilton of MIT in 1969, with listings of the Apollo Guidance Computer source code. As lead designer of the Apollo on-board guidance software, Hamilton pioneered engineering methods for reliable code. You can browse the code here.