home sketches open source talks

Why you should learn graphics programming

I’ve been programming in a lot of different areas for over 15 years now: websites, system admin/devops, database applications, backend worker processes, machine learning pipelines, marketing automation tools, and more. I would dabble with graphical programming environments like Processing and shaders occasionally to draw with a computer, but never really got into it. It wasn’t until recently that I’ve been doing machine learning with image processing that I got really into graphical programming.

Graphical coding has a few different names. Some people call it creative coding, graphics programming, generative art, or poetic computation. They all mean slightly different things, but the common theme is that they all use computer code to generate graphics. Creative coding usually means coding for expressive purposes versus functional purposes. My friend Taeyoon Choi doesn’t like to call it creative coding because it implies that other types of programming is not creative and I agree with him. For this post, I will use the terms creative coding and graphical programming interchangeably, but it applies to all computer generated graphics. Regarding creative coding languages, I mostly use p5js and Processing, but there are many other graphical programming environments like GLSL and WebGL. So anyway, after I got into creative coding, I had this aha moment where I thought creative coding should be taught to everyone and that it will help make you a much smarter person. So I’ve sort of become an evangelist for creative coding and I talk to a lot of new programmers these days about it. I often hear “creative coding seems cool, but how is it useful for real work?” I think all programming is great to learn, but I want to talk about why creative coding in particular is important and I’m going to try and answer that in 2 parts, why learning creative coding is useful, and what kind of work do creative coders do.

Part 1 - Why creative coding is useful

Math and STEM Math is a key subject to learn throughout your schooling, no one can argue with this. I studied a LOT of math growing up, so much that I ended up studying it for my college degree. What is ironic about that is I didn’t get a chance to use it much as a programmer as I was spending a lot of my time just glueing things together. When I got into creative coding, I saw it as a great way to really test out my intuition with math. I found it like being a kid in a candy store, I went through many of my old math books and took functions and algorithms and drew them to the screen and played with them. I still study math in my spare time and I can honestly say that it has accelerated my understanding of many math concepts from linear algebra, to calculus, to physics and much more. Basically all graphics programming is literally writing math. That might sound scary to a lot of people, but before you form too many opinions, I implore you to try it out, take an area of math that you want to have a better understanding of, try to draw some aspect of it with code, and then tweak some of the variables related to your drawing. Just by being able to tweak the variables and seeing the output, you will build stronger mental models of how the math works. This doesn’t apply to just math, but anything from STEM- science,technology,engineering, and math. And If you didn’t learn from your interactive drawing, at the worst case, you just created your own artwork :)

Simulations and Models

Graphics programming is often used for simple simulations and building models. What exactly is a simulation? According to wikipedia it is “the imitation of the operation of a real-world process or system over time”. Simulations are often visual, like a city simulation, forest simulation, or ocean simulation. In more scientific areas, a simulation is called a model. You could build some simple simulations for research purposes or just for your own understanding. I’ve built some very basic simulations for studying intelligence. If you are studying natural phenomena or natural sciences, you might be able to apply creative coding to your research. These simple simulation don’t even have to be super accurate, sometimes its good enough to just see a simple simulation of some problem you are thinking about and that can lead you into insights or other ways to look at your problem. An early version of an ant simulation I built Teaching Using creative coding as a teaching tool is very powerful because so much of our learning and understanding is visual. Writing programs to be run from the command line can be scary to many novices. Having instant feedback from visual coding enables a user to quickly visualize connect the input of code to the output. Plus the user can then tweak the variables and see what each piece of code does. Most importantly, creative coding allows for a lot more FUN, because you can really play around and create new and beautiful things. Sometimes programming can get pretty boring or tough. If you can increase the fun factor, it will keep your student(s) much more engaged and likely to continue push through their struggles. If you have to teach new programmers, I would highly recommend you start off on creative coding before moving to more traditional methods of programming. I have a dream to one day create a full computer science curriculum using creative coding libraries.

Becoming a better programmer

I think its safe to say that computer science is an important skill and more and more people continue to learn how to communicate more directly with computers. There are so many different areas in programming that most people cannot learn all of them. If you can spend more time programming with more mind bending ideas and different paradigms, it will make you not just a better programmer, but a better thinker. I have spent time trying to learn the more weirder and different programming concepts like Lisp,erlang, neural networks, smalltalk, monads, and it has really helped expand my thinking. I think that creative coding is definitely one of those concepts you should learn to expand your mind. Whether you are just getting started in programming or you have been programming for years, it will help you immensely if you can take some time to try creative coding.

Part 2 - what kind of work do creative coders do

Teaching

I mentioned teaching earlier, you can go out and teach creative coding as a job. There are many universities that have a creative coding curriculum, its usually part of the media arts or computer science programs. Most large universities have this like NYU, MIT, Carnegie Mellon University, and more. A lot of high schools also teach an intro to computer science class. If you like teaching, this could be a cool job.

Advertisements and Creative Agencies

I have a love and hate relationship with advertising. Some people consider it a necessary evil, advertising can be considered to be at a unique place, it is at the intersection of technology, money, and mainstream consciousness. Usually its creative agencies who use creative coding to create new advertisements. So people who are working here can be involved in some very cool campaigns. There are a bunch of cool creative agencies like R/GA whose focus is combining technology with storytelling. Many of these agencies deploy creative coding technologies to create interactive installations using different media formats like TVs, projectors, LEDs,etc.

Storytelling

This has some overlapping with advertising, just without the ads :) Storytelling is done across many mediums like comic books, tv shows, and movies. I have not personally seen a lot of creative coding being applied here, but I know its being done. I thing there is a lot of fun work that can be done here and I’m surprised creative coding is not being used more here. If there are people using creative coding here, I would love to here from you. I’m working on a side project with some friends that is a mini web series using all code to make the animations.

Video games

Video Games are basically just another extension of simulations. You probably already know about video games, so I’m not going to go into any detail here. Its a natural jump to go from graphics programming to video games. Games often do help people relax and in some cases improve human performance such as hand eye coordination. I’ve heard it can be a grueling job with long hours, but it could be fun.

Any programming job

So I see creative coding as a gateway drug to doing general programming and once you are able to program in one domain or language, it gets much easier to switch to other programming languages and domains. For example: after learning to draw with a computer, then it might make sense to work with external web services so you can make your sketches get data from the web. Or going from Processing to graphics shaders is a logical jump. So if you keep programming and trying new things, eventually you build understanding around it and you could get any programming job with enough time and practice.

Data visualization jobs

Data visualization is increasingly important as we get more and more data to process. The job of the data visualizer is to take data and make sense of it, and present it in a way that the audience can understand. There are many companies who are dealing with vast amounts of data and need different ways to summarize and show their data. Typically a data visualization job would go to analysts, graphics designers or data scientists. This is a tough and rewarding job and requires strong analytical skills.

Art

Being a full time artist is the dream of many people. It is a very tough road and no guaranteed success. Still, many people attempt this route and I commend them for it. I know of a few creative coders who use languages like Processing to produce artworks to sell such as Tyler Hobbs Using creative coding here could mean creating completely digital artworks or even physical objects that are connects with computers like art installations. There are large thriving communities of digital artists in places like New York City and San Francisco.

Other jobs?

I would love to hear from you if you are a creative coder for your day job and doing something different from what I’ve listed above.

Closing thoughts

I hope I’ve convinced you that at least dipping your toes into creative coding can be mind expanding, fun, and potentially help your career. I personally think it is the easiest way to get into programming. I want to see more young people getting into programming and creative coding. Since I started creative coding, I have been drawing new sketches every few days. I put most of them online here: http://jtoy.net/sketches I also created a challenge site that sends out a weekly challenge for you to try and draw: http://pushpopchallenge.com