Many people still see coding as purely technical—just logic and rules, with no room for creativity. Lines of code aren't often thought of in the same way as brushstrokes on a canvas or verses in a poem—open to interpretation, emotion, or artistic expression. But that assumption misses a key point: coding can be a powerful form of creativity.
In fact, as Paul Ford reflects in What is Code?, "code is a system of thought," not merely a functional tool. It represents a new way of thinking about art, design, and even literature, showing how we can express ourselves through the interaction between human and machine. The digital age hasn't limited our ability to express ourselves—it has enhanced it. Coding has opened up entirely new ways to create, from digital art and AI-generated imagery to interactive storytelling and dynamic web experiences.
This site will guide you through some of the many ways code has transformed how we express ourselves, challenging the idea that coding is only technical and showing just how innovative and artistic it can truly be.
Art doesn't always need a paintbrush or a canvas. With generative design, the artist's medium is code, and the creative process unfolds dynamically, often producing results the artist didn't initially predict.
In his The Theory of Affordances, J.J. Gibson explores how perception is shaped by the affordances of our environment. Similarly, in generative art, the affordances of the code-its pseudorandomness, or the complex algorithms it can process—create a space where the artist is not the sole creator but a collaborator with the machine. The code's affordances shape the possibilities of the output,
Try it for yourself. Use the controls below to create your own generative artwork. Adjust the colors, density, and radius to explore how small changes in code can result in entirely different artistic outputs.
ASCII art is one of the earliest forms of creative expression using computers. In a world before modern graphics and digital drawing tools, artists used letters, numbers, and symbols to create intricate images. These artworks, often limited by the constraints of the medium, found creative ways to express complexity using simple characters.
As Paul Caplan writes in What is a JPEG?, digital images, whether in JPEG format or ASCII art, are often overlooked as objects in and of themselves. But even these compressed forms of expression hold significant value as they represent a new digital layer of our visual world. ASCII art might seem basic, but it demonstrates how even the earliest digital tools were used for creative expression.
Type something into the box below and watch it turn into art. This shows that code itself can turn something as mundane as text into something artistic.
Coding isn't just about solving problems or building functional systems—it can be playful, too. In this playground, you can manipulate a simple block of code that changes dynamically as you adjust sliders. You're not just playing with colors, sizes, and shapes—you're experimenting with how a small tweak in code can have big visual results.
This kind of interaction is at the core of web design, game development, and other creative digital fields. Code becomes a tool to manipulate and create in real time, offering instant feedback for the creator. It's a medium where imagination and logic meet.
Use the sliders and text fields below to change aspects of the square. The immediacy of feedback here shows how code can be a canvas for experimentation and expression. If you right-click on the square and select "Inspect," you can see the code change in real time!
Storytelling has always been a central form of human expression. But with the rise of computing, we've seen the development of entirely new ways to tell stories—ones that go beyond traditional linear narratives. Interactive literature, choose-your-own-adventure stories, and text-based games have pushed the boundaries of storytelling, giving the reader agency in the direction of the plot.
Click on the posters below to play two great text-based CYOA games!
Not all code is created equal. While there are countless ways to solve the same problem in code, not every solution is considered "beautiful." Beautiful code is elegant, easy to read, and simple to understand—even for others who didn't write it. On the other hand, ugly or poorly written code is tangled, complicated, and hard to follow. Really tangled code with lots of convoluted jumps is often called "spaghetti" code
function sum(arr) {
return arr.reduce((a, b) => a + b, 0);
}This example is concise, easy to read, and leverages built-in functions. It's efficient and clear about what it does: it sums up all numbers in an array. Anyone looking at it (with some JavaScript coding experience) knows what it does at a glance.
function sum(arr) {
let total = 0;
for (let i = 0; i < arr.length; i++) {
total += arr[i];
}
return total;
}While this code works, it's longer and more repetitive. It uses a manual loop, which may be easier to read for some and compared compared to the previous one-liner. It gets the job done, but there are ways to condense.
function isPrime(num) {
if (num <= 1) return false;
for (let i = 2, sqrt = Math.sqrt(num); i <= sqrt; i++) {
if (num % i === 0) return false;
}
return true;
}This code is efficient and clean. By checking up to the square root of the number, it reduces unnecessary checks. It's concise, with early returns to handle edge cases clearly.
function isPrime(num) {
if (num <= 1) {
return false;
}
let isPrime = true;
for (let i = 2; i < num; i++) {
if (num % i === 0) {
isPrime = false;
break;
}
}
return isPrime;
}This code works but is inefficient. It loops through the entire number range unnecessarily, and the use of a flag (`isPrime`) adds complexity where it's not needed.
Writing beautiful code isn't just about making it work—it's about writing it in a way that is easy to understand, maintain, and improve. Beautiful code is clear, logical, and organized, so that anyone can read it and know exactly what's happening. Spaghetti code, on the other hand, is messy and difficult to work with.
In coding, just like in writing or art, there's elegance in simplicity. Clean, beautiful code makes life easier for future developers and even for your future self when you come back to it later. It's the difference between scribbling down a shopping list in a rush and writing a carefully organized to-do list that you can follow effortlessly.
As we've seen throughout this site, code is much more than a series of instructions for computers to follow. It has opened doors to entirely new forms of creativity—whether it's designing generative art, creating interactive stories, or writing clean, elegant code that solves problems beautifully.
Caplan's exploration of JPEGs reminds us that even in their compressed or minimal forms, digital objects hold artistic significance. ASCII art and generative designs are just the some of the few early ways we pushed the boundaries of creativity using code. The journey doesn't end here—continue exploring how code can transform your creative vision into reality.
The beauty of code, as Paul Ford suggests in What is Code?, lies not just in its functionality but in how it interacts with human thought. Code is a medium that reflects our thought processes and creativity, a form of self-expression as valid as any brushstroke on canvas. And just as J.J. Gibson's Theory of Affordances shows how our environment shapes perception, code's inherent affordances shape the creative process, opening new possibilities for artistic expression. Some believe that because the result of code can be predetermined before it's executed, that it cannot be beautiful, subjective, or artsy. However, the beauty of code lies in the process of creation, the thought behind it, and the way it interacts with the viewer. If the code is lost, and all we have left is its output, we are left to ponder what brought it into existence, or why.