Introduction to Programming

using the Processing language

Lecturer: Amalia Kallergi of the Media Technology MSc program at Leiden University
Lab assistant: Tijl Kindt

Course developed by Bas Haring (2004)
Alterations by Maarten Lamers (2005-07), Mark Huiskes (2008-09)
Course format revised by Amalia Kallergi (2010)

Introduction    day 1    day 2    day 3    day 4    day 5    day 6    day 7    Max/MSP

Introduction

These sheets are to be used for the Introduction to Programming course - using the Processing language. This course is intended for the Media Technology MSc program of Leiden University, but is open to other students as well.

NOTE: The Introduction to Programming (IP) course consists of 2 parts: a Processing based part, introducing fundamental concepts of programming and a Max/MSP based part, exemplifying a different programming paradigm (visual programming). These sheets discuss the Processing part only (7 lectures). Information on the Max/MSP part (3 lectures) can be found here.

In this course, we will be addressing basic principles of programming. For our examples and assignments, we will be using the Processing programming language/IDE. Yet, focus will be given on fundamental concepts and algorithmic thinking rather than on (the syntax or peculiarities of) Processing itself. Basic programming concepts often reoccur between programming languages: With the basic understanding of programming offered in this course, you should be able to explore programming in other languages as well.

Processing is a programming language and development environment initiated by Ben Fry (UCLA) and Casey Reas (MIT / Broad Institute). It is a kind of 'shell' around Java (another programming language...) that greatly simplifies programming of visuals. Initially created to teach fundamentals of computer programming within a visual context, the project gained immense popularity and an enthusiastic community of users and contributors. Processing was awarded a Golden Nica at the Ars Electronica 2005 festival, for introducing a new audience to computer programming. Open-source and multi-platform, easy to learn and with a very supportive user base, Processing is an ideal tool for an introduction to programming course.

You should consult processing.org for more specific aspects of the language, for references, demo applications and downloads. These sheets are only meant to be an aid for the course.

Structure of the course

The course consists of seven (7) lectures/workshops: Introduced concepts will be immediately studied and exercised in practice so your active participation is required! During the class, we will be studying small examples of code, hacking existing code, performing algorithms and, of course, writing our own programs. Please note: Attendance to the workshops is obligatory!

Furthermore, you are expected to complete a number of assignments and a written examination.

How to use these sheets

Each day starts with a summary sheet. This sheet provides an overview of the programming concepts you should be familiar with by the end of the day. Concepts specific to Processing are also mentioned. Finally, you should be/become familiar with all the keywords listed.

Extensive material on the topics of each day is also provided. No course book is required.

NOTE: The source code presented in the sheets was tested with Processing version 1.5.1.

Assignments

During the day, you will be given several small assignments to practice and explore the introduced concepts. You will get plenty of practice time and the opportunity to discuss your solutions or difficulties with the rest of the class.

Next to the workshop participation, there are three (3) larger homework assignments for you to prepare at home. Each homework assignment has its own deadline (to be announced). Please note: All three homework assignments are obligatory!

Course topics

  • Day 1 - Variables, data types, operators & assignments
  • Day 2 - Selection: Conditions & Logic operators - Mouse interaction
  • Day 3 - Iteration: Loops - Functions
  • Day 4 - Classes & designing (complex) programs
  • Day 5 - Arrays
  • Day 6 - Recursion, data structures & sorting
  • Day 7 - Image processing- Libraries
  • 3 lectures Max/MSP (by Hanna Schraffenberger)

Examination

The course is graded by means of a written examination (95% exam + 5% participation [at the lecturer's discretion]). Students must complete both parts of the course (Processing and Max/MSP) successfully, i.e. complete all lab and homework assignments for both Processing and Max/MSP.

The exam is on Tuesday 20th December 2011 (10h00).