How I Approach Creative Coding

What exactly do I aim to create?

I'm not trying to make art through creative coding. Instead, I want to create a code that generates something artistic. And this distinction is important: I don't know what art is, so I don't consider myself an artist. I think of myself as an engineer.

How do I approach the creation process? I don't have a definitive answer—I'm still searching. But here is the working philosophy that guides my exploration:

 

My Three Philosophical Pillars

1. The Balance of Order and Chaos

Creative expression requires a delicate mix of elements.

  • Simple and too straightforward = Boring.
  • Too complicated or merely complex = Lacks inherent beauty.

I believe we need to find the balance:

  • Regular forms are beautiful, but they become monotonous if too simple.
  • Randomness alone is not beautiful, but it can occasionally yield interesting results.

The key is to judiciously combine simplicity, complexity, regularity, and randomness.

Examples:

  • Symmetrical shapes with contrasting colors.
  • The regular repetition of complex, nuanced patterns.
  • Generating many forms based on random numbers with a normal distribution.

 

2. Embracing Discovery Over Intent

This is perhaps the most crucial mindset:

Instead of starting with the goal ("I want to make this, so I will write this code"), I start with the process ("If I write this code, what unique outcome will emerge?").

I am primarily interested in discovering the unexpected possibilities that the code itself holds, rather than forcing the code to realize a predetermined vision.

 

3. Bugs Are Not Enemies; They Are Allies

In my method, bugs are your friends.

When I was attempting to generate a wavy surface , I intended to use Perlin noise correctly.


But due to a simple mistake, I got this unexpected result:


I wrote a bug like this:


 z = noise(x, y) * 10.0;  // BUG : should be -> noise(nx, ny)
 nx += 0.005;
 ny += 0.005;
    

However, this mistake was a breakthrough! It helped me realize that the `noise()` function in Processing is +/- symmetrical. If I had used Perlin noise "properly", I would have missed this discovery.


I absolutely love the buggy one! This is the power of embracing errors.

The Accidental Programming Method

Allow me to respectfully propose a new, tongue-in-cheek programming method for creative coders. Accidental Coding is the mother of creative coding.

If you complete some work, try changing something thoughtlessly.
For example:

  • Use an extremely small or extremely large parameter value.
  • Change a `+` operator to a `*` operator.
  • Add a new `sin()` function arbitrarily into your formula.

The key word here is "thoughtlessly". Do not be afraid of errors, abnormal ends, infinite loops, zero divides, or the crushing disappointment after a five-hour render.

The Proper Etiquette of Accidental Programming:

  "I have no idea how this code I wrote is working, but it works.
   If it worked, it is right!"
    
  "I reserve the right to waste my CPU time as I wish!
   That is the only freedom heaven has allowed me in this digital age!"

If you adopt the Accidental Programming Method, you can still create something amazing, even if...

  • You are not good at math (like me).
  • You have poor programming skills (like me).
  • You are suffering from a drought of new ideas (me, often).

Enjoy My Creative Coding Examples

You can find many examples of creative coding made with my Accidental Programming Method throughout this blog. Most of these are Processing code examples, with some p5.js examples as well.

You'll find the result images and the full source codes. Enjoy the discoveries!


 

2017/Nov/23
Update 2017/Dec/24
Update 2018/Dec/14
Update 2019/Sep/04
Update 2025/Dec/11

 

3 Comments
  • Unknown
    Unknown Monday, November 22, 2021

    I just discovered your website. You have made my brain explode and my synapses reconnect in different ways. I think this is a good thing. Thank you!

  • deconbatch
    deconbatch Friday, December 10, 2021

    THAT IS WHAT I AIMED TO DO. 🤖

  • Petri Keckman
    Petri Keckman Saturday, January 22, 2022

    You say you are not an artist, but I think you are and you are a truly good and productive artist! :) I'm even little jealous, because you better artist than me! I think. Why don't you wanna be an artist? No one knows what art is, it is not easy to define, but when I look your images and animations, I see beauty. You opposite than me: I am above all an artist (or WANNABE) and only a secondly coder. https://petke.info/

Add Comment
comment url