Adventures in Cubism
The artwork speaks for itself..
I’m finding it hard to write a post about making a program. What is there to say? The code speaks for itself… right? I’m going to articulate something that is right there in the code plain as day? Is it a bad or good sign that I’m having these thoughts. Maybe I’m getting better at coding? I don’t know…
It becomes easier when I think about the adventure of solving the problem and not the resulting program as a whole. Perhaps it’s because of I’m terrible at programming, but I’m definately thinking about what I WANT long before considering HOW I’m going to do it. Maybe I’m rediscovering the scientific method idk, but it definately feels like a journey when I start to think about where the bodies are buried along the way. I’m sure that to a professional programmer these are just n00b mistakes, or maybe I’m going through the transformation into a ‘programming mindset.’ Either way, I’m approaching this blog post the same way - I know that I want to talk about making my mondrian git repository, I’m just not sure how to go about it. Perhaps the beginning is the best place…
Make a painting and watch it change!
I had visualized my goal long before I’d figured out how to do it. After several conversations about how to explain ‘version control’ to artists and librarians with @mminkova, overlaying that against past experience of enjoying Bob Ross, and visits to the Tate Modern, I knew that if I could show changing colors over time in a simple painting it would be a useful visualation for understanding version control. Visualizations usually work for me at least. :)
I like the geometrey of Mondrian paintings and from a beginner’s perspective they seem the easiest to replicate, so a good place to start. If I’m going to demo version control for a group I want it to be accessible, so that means it has to be online. I already know how to host web pages on github (this blog) so it’s easy enough to extend that for the project, the first step is to figure out how to draw a painting!
Search engines got me to HTML5 canvas object with a basic demo.
1. Create a basic html page.
2. Insert a
3. Insert a
<script> tag with geometry that modifies the canvas you want to draw.
Simple enough! I was able to draw a basic mondrian painting with a single html page!
Now that I’ve created a picture the rest should be easy! - Create some sort of slider that represents changes over time. (i.e. a point in the commit history) - Determine how to use the github API to pull the contents of a git log entry. - Modify the visual canvas displayed when the slider moves.
The good news is that my outline encompasses all the major tasks I needed to achieve to get it to work. The bad news is it wasn’t as simple as all that!
Get to your target fast!
I think there are probably many optimizations I could still make, but I’m happy with the get it working philosophy of learning right now. Mastery and expertise can come later.
Getting over the finish line feels very good. And that’s the method of learning that’s working best for me right now. After I finish something I feel inspired to go back and tweak and perfect it, after all I’ve got something to show no matter what now!
Excitement about the project and the outcome is my goal, once I’ve got that enthusiam then I’m motivated to go back and sort out the little things… like finding out Mondrian’s style is actually called De Stijl and not Cubism. :)