Dev

05 Feb 2013

Originally I wanted to do something generative, but then I came across a question I wanted answered, so I decided to do that instead.

Progrmming Style is a somewhat loose term. Having good style helps your code look nice and clean, but honestly good style it subjective. There are many guidelines, and there are many languages. I am curious to find patterns in style across languages and over the course of time.

I plan on using GitHubs API (http://developer.github.com/v3/) to data on popular repositories. I mainly want to grab the individual commits for a specific file in the repos (which can be specified by the user of the Infovis).

I then plan on abstracting the code into a bunch of colored rectangles based on syntax highlighting. The infovis shouldn’t care about the words in the code. Only spatial location of content is important. So imagine converting the code below into a bunch of colored rectangles.

Screen Shot 2013-02-05 at 11.18.56 PM

 

Once I can map code to rectangles, I can show its change in a very abstract way. A new commit can be presented by animating some rectangles. I can emphasize or demphasize the location of comments and definitions. I can even show the negative space to the left side, showing the indentation scheme that was used.

I’m curious to see the evolution of style on different GitHub communities, communities which differ in language used, people, and application. We’ll see how this turns out!

Update:

Here is a very basic visual of mapping keywords to rectangles of a C file on my computer. Darker rectangles represent comments. Hopefully this can help clarify what I mean by blockifying code.

code in blocks