> classes > exploratory programming, spring 2015

NMDS 5444 - Exploratory Programming

Draft/tentative syllabus for a class at the New School’s School of Media Studies, Spring 2015. Instructor: Nick Montfort

Course Description

This course is about how to think with computation, how computation and media interact, and how we can understand computation as a part of culture. Programming is introduced as a way to iteratively design both artworks and humanities projects, in a process that allows the programmer to discover the direction of the project during programming. The idea of exploratory programming differs from the instrumental programming done to create an an app or a banking system in compliance with a pre-determined specification. No previous background in programming is required.

The course mainly consists of in-class programming exercises of various sorts, from following along and inputting code through “free projects” in which students not only choose how to accomplish a programming task; they also choose (or discover) the direction of the project. Students are assigned a free project each week; each of these is presented at least briefly in class. There will be some time for longer discussion and critique, but even shorter presentations will serve to show the variety of perspectives in the class and the many ways in which programming can be used to explore. To supplement the learning that happens by programming, a draft textbook will be provided and there will be short mini-lectures on particular concepts.

Jan 28

1. First Steps

In class, students modify a JavaScript program, changing out strings and using trial and error to learn about how programs works. Each student creates a Web-ready text generator. These are read aloud in class.

Comments on exploration and exploitation, programming as inquiry. · Overview of the course: Concepts covered, media to be manipulated, programming languages used. · Arithmetic expressions in Python, formal validity, syntax and semantics, and variables are introduced with in-class exercises.

Free project assigned: Revise and rethink your modified JavaScript generator. Develop a generator that is significantly different in some way — produces syntactically different sentences or lines, or draws from a much larger pool of texts, or has a different rhetorical or poetic purpose. Keep it self-contained, though, and keep the code about the same length.

Feb 4

2. A First, Fundamental Function

Presentation of students’ version 2 text generators.

A first program (function) in Python: “Double, Double.” The interface to this function is discussed and the concept of interface (as in Application-Programming Interface, not Computer-Human Interface) is introduced. · In class, students are asked to modify “Double, Double” (although we have only discussed how to call it, not how it works). · Abstraction is introduced with in-class exercises. These help to explore the concept of scope. · Iteration (and specifically the “for” loop) is introduced with in-class exercises. · Types are discussed with reference to polymorphism and type mismatch errors, again, accompanied by in-class exercises. · The conditional (“if”) is introduced, along with a short in-class project.

Free project assigned: Modify “Double, Double” again, putting your new understanding of programming fundamentals to use to develop this function in a new way. Keep it short, however — no more than 10 lines at the very most.

Feb 11

3. Standard Starting Points and Critical Code Studies

Presentation of “Double, Double” programs as modified by students.

We consider three famous programs that have historically been offered as the first program for learners to encounter. We input and run these, learn about computation from them, make modifications to them, and also critically discuss the ideas about computation that they project.

Free project assigned: Your own “starter program,” informed by your views of how computing should be presented. It should, of course, be concise — short enough for someone to easily type in.

Feb 18

4. Simple Text 1

Presentation of student “starter programs.”

In-class exercises to explore and explain slicing, splitting, joining, and sorting strings. Large public-domain text files are loaded and used in exploring how strings can be manipulated and words counted.

Palindrome verifiers of several sorts are developed in class.

Free project assigned: Develop a system to detect palindromes or other unusual lexical phenomena in large text files. You could also detect tautonyms (murmur, yo-yo, Boutros Boutros) or charades (onus on us, together to get her), for example. You should choose the phenomenon, and select one that is fairly easy to detect using simple text processing methods.

Feb 25

5. Simple Text 2

Presentation of student lexical checkers.

Regular expressions are introduced, explored in text editors, and used in Python programs.

Free project assigned: Develop a program to compare a single poetry book and a single prose fiction book along whatever lines you see fit, extending the techniques used in the last two classes, including those involving regular expressions.

Mar 4

6. Image 1

Presentation of poetry/prose comparison programs.

Simple image generation with Pillow. · Simple image manipulation of images of any size, including lightening/darkening, increasing contrast, and flipping an image, done during in-class exercises.

Free project assigned: Develop your own image manipulator, which can do something fairly simple (such as flip along a different axis) or something less usual (posterize the image).

Mar 11

7. Image 2

Presentation of student image manipulation programs.

Blurring an image. · Manipulating many images, analysis of many images.

Free project assigned: Given a directory of images, gather some data about all of these. For instance, which is the least red? Which is the lowest contrast? You should choose what to determine about the images; your program should work on any directory that has nothing but images of the correct format.

Mar 18

8. Complex Text 1

Presentation of student image analysis programs.

Some facilities of TextBlob. Computationally determining words, sentences, and particular parts of speech. Introduction to WordNet.

Free project assigned: A creative program to conflate two texts. Have your program take any two text files as input and produce a new text that has elements of each.

Apr 1

9. Complex Text 2

Presentation of student “creative conflation” projects by reading some of the best results.

Classification of texts: A minimal classifier to determine whether verse or text is read, using only one feature. Then, developing a simple sentiment analysis classifier and using the built-in classifier.

Free project assigned: Develop your own classifier, however simple, that can distinguish texts based on a feature of interest to you.

Apr 8

10. Statistics and Visualization 1

Presentation of student classifiers.

Introducing Processing; creating a first visualization. · Essentials of statistics. In class, to follow up on having developed code to determine the mean, develop code to determine the median, mode, and variance/standard deviation of a sequence. · Essentials of probability.

Free project assigned: Re-weight your text generation system and try to make it rhetorically different simply by changing the probability that each option will be selected.

For next class, also gather the data you will use for the end-to-end statistical analysis project.

Apr 15

11. Statistics and Visualization 2

Presentation of re-weighted text generators. Also, students have data sets (or other “raw” data) for work on the end-to-end statistical exploration projects.

Free project assigned: Exploration of data that is of personal interest using statistical techniques and (optionally) visualization. Work on end-to-end projects in class, with desk critiques and discussion of problems that arise with data cleaning/preparation, writing code to do statistical analysis, and presenting the results visually or otherwise.

Apr 22

12. Animation, Sound

Presentation of end-to-end statistical exploration projects.

Using Processing, learn the basics of animation through programming in class.

Engage with sound in a brief but fun exercise to create bytebeat music from a single arithmetic expression that depends on time. Play the results in class and discuss them.

Free project assigned: Create a clock (some display of the time, probably a fairly unusual one) using Processing. You can decide how important it is for the clock to be easily read and understood, what sorts of elements will constitute it, and what design will be most suitable. Your clock must have a different visual appearance each second of the day and the same visual appearance at the same time on different days, but everything else is up to you.

Apr 29

13. Interaction

Presentation of student clocks.

The essentials of interaction are introduced, including accepting typed input (in Python), detecting keypresses (in Processing) and the use of the mouse (in Processing).

Free project assigned: A generated landscape. Code is provided and may be examined or modified. The project is to create a virtual space larger than the Processing window, one which can be navigated using some interactive means (keypresses or the mouse, most likely). Furthermore, what appears in the space must be generated by code rather than hand-coded.

May 6

14. Onward 1

Presentation of student generated lanscapes.

Discussion of the free software concept in the context of programming and exploratory programming.

Free project assigned: The “Entirely free project.” (At least, over the universe of this class.) Choose any area we have covered in class in which you would like to work further. Develop an interesting, small-scale inquiry/creation through programming. This is not a large-scale “term project” that is supposed to sum up one’s class experience; it’s a one-week project like all the others. Part of the challenge is selecting a project to do that will be interesting while the overall project is still quite tractable and concise.

May 13

15. Onward 2

Presentation of “entirely free projects.”

Discussion of strategies and tactics for continuing to inquire and create with programming.