Data

We can divide programs into two parts: computation and data. Computation has behaviour. It makes things happen. Drawing on the screen, for example. Data has the structure. This structure determines how computations take place. For example, we construct an Image that describes the picture we'd like to see on the screen. We need both. Data doesn't do anything on its own, and computation need data to decide what to do.

So far we've created lots of data and computations, but all our data has been of types provided by Doodle or Scala. We're now going to learn how to create and use our own data.

We'll approach learning from two different angles: