Playing with Cards

Everything is a Card now.

A.G.
Design Science
Published in
3 min readJun 29, 2013

--

Maybe that should have read, “Everything is a Now Card.”

https://gist.github.com/antiface/ca7b5ee284244a705768

The snippet of code above is something I wrote the other day. There’s nothing really special about it except maybe the fact that it’s one of the only actual functioning pieces of code I’ve ever written in my life.

I love looking at snippets of code / chunks of code. There’s something profoundly beautiful about a function in a program. Python for me, writing code in Python at least, is a fine art. I’m an artist, I have a great deal of experience in the arts, and writing code to me is exactly the same as writing any text, or painting something on a canvas.

My snippets are meant to be observed as tiny works of art.

The difference between one of my paintings and one of these snippets of code, I guess, is that my code can actually “do something” other than just sit there, being observed and whatnot. It can be “run” on a physical machine, making the machine “do things”.

https://gist.github.com/antiface/3459adecb517e8584f91

This one is slightly more elaborate, the snippet shown here above. I got fancy with my naming strategies, which is probably never a good idea. “addQualiaToDict” might look and sound cool, but chances are no one will know what “qualia” means, which appears almost every second line in the code. The magic, and the beauty, here, is that you’ll understand fully once you run the damn thing.

So these are my two Card-type designs. They are meant to be the simplest note-taking apps I could possibly write, knowing what I know, which isn’t a hell of a lot. I elaborated on these over the course of a few days and ended up adding functions that saved the output into JSON format in a .json file, or directly to a .txt file. I even wrote some snippets that saved everything in a MongoDB database.

What I am trying to work towards is a Class object in Python, that to me is best represented as a “Card”, at least in the mind. It is nothing more than an index card, which I tried to show by posting screenshots of what the code actually looks like on the page when it has the proper highlighting. Isn’t it lovely? Probably not.

The point really is that once you know how to write something like I have just written, you actually know much more than you think. I encountered a series of serious problems trying to write just those two stupid-looking little snippets of crap-code. Next time around, though, I will be able to write something much more elaborate and complex. I will also be able to go back to the snippets above and make them much more elegant, maybe weighing only half the number of bytes.

All that really matters to me right now is that I love my little logCreate and my little qualiaFunc. I think we will do great things together someday.

--

--