Introduction
What is a computer program?
Applications and systems
Traditionally most people have thought of computer programmes as synonymous with computer applications - complete systems that offer bundles of related functionality and a user interface to achieve a range of related goals. Microsoft Word is probably the most common example. But a web application, such as the Mapping Women's Suffrage web site (which is much more than a static set of web pages), is also a kind of software application. Creating such applications is important. But it's also expensive and complicated, requiring a team of people with diverse skills working together in a well planned and managed way, and a long term plan and commitment to maintenance, which is always costly.
Fortunately, much of what we do in digital arts and humanities (DAH) is simpler and quicker. We write a different kind of program, working in a very different way.
Coding within existing platforms
A program can be something smaller and simpler: a set of rules, in sequence, that takes in inputs according to a predefined range of possibilities, represents those inputs as structured data, runs a series of clearly specified actions, perhaps transforms the data, perhaps waits for further inputs, and outputs signals. Algorithm is another word for programme. Although that tends to get used for smaller chunks of processing, with a programme being constructed out of a set of algorithms. We're interested in something in between. Much of the coding that we do is smaller scale, and happens within existing applications and systems - platforms that provide simple, easy, interfaces to data and human interactions, and means to write and run code quickly and simply, to support our investigative and experimental research methods.
DAH tinkering as research method
Often in DAH research we write small programs to look for patterns in data, to test a hypothesis, to tell stories, or to experiment with what is possible. Programs that run within existing software and hardware platforms. We don't need a big team for this. But we do need a good community of fellow DAH researchers to help us on the way.
In the first of the examples we will look at, we take a database of records about survivors of the Titanic disaster, and apply simple (but powerful) algorithms to look for meaningful patterns (did they follow the Birkenhead protocol?) and interesting stories. The example is taken from a popular introduction to data science, which goes further, using AI algorithms and data structures to enable new kinds of investigation.
Jupyter Notebooks
In this case we use a "stack" of tools, assembled into a platform: the Python programming language, the CSV data format, Jupyter Notebooks (a way of combining research commentary, data, and algorithms), GitHub Codespaces (a convenient service that allows us to run code in the cloud on someone else's servers), several common Python code libraries (collections of useful algorithms, so we don't have to write much from scratch), and Microsoft's online Integrated Development Environment (IDE) Visual Studio Code. All of this is free to use! (there is a limit on how much processing we can do in a free codespace, but we'll not get near that). In the wider research method, we break out of the data supplied, and enrich our knowledge of the people and events using other web sources.
Raspberry Pi Pico microcontroller
In a second example, we combine working with structured data and using physical interfaces for human-computer interaction (HCI). In this case we are using a Raspberry Pi Microcontroller. This is the kind of system used in interactive museum exhibits, and in remote sensing systems. We could use a similar platform for getting live data from the field and doing analysis in real-time.
Javascript web programming
Our third example shows how we can use a second programming language, Javascript, to inject interactivity and to use data in web pages, building on an existing web platform. This also illustrates how we can write algorithms that receive from and send data to other systems, in structured formats, called application programming interfaces (APIs). This is most often done over the web, using the same HTTP communication channel that web pages use. That is a very powerful thing to do. Meaning we can make a whole web of data and algorithms.
Tinkering in other platforms, including immersive tech
There are many other examples of this kind of small-scale programming in platforms. Every operating system provides a macro language. On the Mac there is AppleScriptLink opens in a new window. One of the most exciting developments currently is the addition of coding tools in metaverse platforms. Using Meta's Horizon Worlds, we can create virtual spaces full of objects. Now we can also code behaviours for those objects, meaning that if we interact with them, they will respond as coded. In the near future this will be able to use generative AI, so we could have a meaningful conversation with a virtual object. The leading augmented reality (AR) platform should be getting a similar system soon. Both of these systems use a "block code" approach - rather than typing in lines of code, we drag and drop visual representations of code into visual algorithms (an approach pioneered with MITs Scratch programming for children).
The artificial intelligences are on their way
This mention of AI leads to another question: will we need to code if AI can do it all for us? Probably. It will be easier to prompt the AI to do the right thing if we have an understanding of how the machines work. We also need to work out why code generated automatically is wrong. So at least for the foreseeable future, this is still an important set of skills.
There are so many programming languages, but no need to panic
Note that there are two programming languages used in these examples. Just two. There are actually hundreds of them, with more coming along all the time (Godot Script is one of the latest, we've been waiting for it for w while). Although on the surface Python and Javascript look quite different, and there are significant differences in where they can be used (in terms of the platform), underneath they do pretty much the same algorithmic work. With a good understanding of algorithms, data, and how to learn about specific tools, we can easily move between them.
Creativity and programming
Finally, to wrap up this section, something about this kind of programming in relation to creativity. Because programming is creative. And this kind of programming is a special kind of creative practice. Some people call it "tinkering". There's a lot of playing with data, inputs, outputs, algorithms, to discover, experiment, and report. Perhaps the most important capability in DAH is to imagine, with an open-mind but informed by a knowledge of data and algorithms, what might be possible given the inputs and outputs we have. To play with that. But also to go further, to envision how we might do more, get different/better data, create interactions, and to lay the foundations for that, creating extendible and reusable programs.
The best way to learn do this is to dive straight in, with some guidance and support, and to start tinkering. But learn from every tinker. Build up a knowledge base of techniques, code, experiences, to build upon.
Next, dive into one of the examples.
Examples
- Python in Jupyter Notebooks for data analysis - looking for patterns in big data, testing a hypothesis, zooming in on a human story.
- Python for coding a Raspberry Pi microcontroller - for physical interactions and remote sensing
- Javascript for data, design, and interactions in web pages
About the author
Dr Robert O'Toole leads the Digital Arts and Humanities Lab at Warwick. He is a philosopher (Warwick), who studied computing, cognitive science, and AI (Sussex), qualified to teach computing (Warwick), and led the successful "full stack" development of Oxford's first online learning platform. He has worked at the interface between technology, arts, and humanities at Warwick since 2001, now as Director of Student Digital Experience.
Robert has designed and developed major web applications, including the first version of Sitebuilder, an online art gallery, and many educational systems. But he most enjoys tinkering with data and interactions for digital arts and humanities research. His son Alexander (a full stack developer) researches new programming languages and methods, fixes his mistakes, and sighs at his deficiencies.