CMPT 127 - Computing Laboratory

Instructor: Richard Vaughan

How to get help


  • 29 Sept: first deadline extended: see revised schedule below
  • 20 Sept: intermediate deadlines announced: see schedule below.
  • 11 Sept: site posted.

Schedule - Fall 2017

As discussed in class, we introduce two intermediate deadlines to help push you along.
  • Labs 0-2 are due 23:59h Oct 10.
  • Labs 0-2 are due 23:59h Oct 3 (extended - see above).
  • Labs 3-5 are due 23:59h Nov 7.
  • Labs 6-10 are due 23:59 Dec 4 (i.e. the end of the last day of classes).

You can not pass the class without meeting these due dates.

You may continue to submit tasks and receive feedback on them all semester, but your final grade will reflect the code submitted before the due dates only.

There will be no new lab assigned in the week of 26 Sept.

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

  1. Wed 10:30 - 13:20 D100
  2. Wed 13:30 - 16:20 D200
  3. Wed 16:30 - 19:20 D300

Vaughan and two TAs are available in lab hours.

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

That's 3 + 10 = 13 hours per week of TA-supported lab time: use it well.

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.

All lab tasks are due 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.
  • The only version that gets graded is the one that exits at the deadline.
  • There is no penalty for not keeping up with the weekly schedule.
  • Each task has equal weight and there is no penalty for skipping one beyond the obvious loss of credit for that task.

An anonymous league table shows everybody's progress.


Your grade will depend on how many tasks you solve correctly. You need at least 75% to pass the class. The class is not graded on a curve.



  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.


See your progress in the labs on the leaderboard.

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
  5. Practice
  6. Composite Data Types
  7. File I/O
  8. Testing and Lists
  9. Memory allocation performance
  10. Interactive, event driven applications
  11. Lab 10 is available for extra credit
  12. C++ classes, 2D arrays.
  13. Lab 11 has no tasks and no credit but gives links to interesting reading on template meta-programming
  14. C++ Templates
  15. (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.