> > At this point it is clear to me (and it wasn't for some odd reason before > this last set of examples) that you could be interested in the fractal > dimension for at least two distinct reasons: 1) you are interested in > something about computer code itself, 2) you are interested in something > about what a given person or group of people do when coding. > > If you were interested in "the code itself", then you might, for example, > get a sample of code widely agreed to be very pretty, and a sample widely > agreed to be very ugly, and compare fractal dimensionality. > > If you were interested in "what coders do", then you might, for example, > watch someone writing a program that had to perform many tasks, and see how > the fractal dimensionality changes as they tweak the code towards a final > project. > > Are these the types of comparisons you have in mind? Is one type of > question more interesting? Is there some third type of question motivating > the project? >
Well, I'm working on building automated refactoring tools in my spare time. Imagine a sort of Roomba that works on code lint instead of physical dust. So far it's a) awesome and b) time-consuming. I think that's likely to continue. I did my first thing in this in 2008, it's kind of an on-again off-again thing. So my interest arose out of the comparisons and contrasts between the code itself in its current shape and the code itself in the shape it will or would take in future, after processing through automated refactoring. So my tools are nowhere near finished but I've done enough refactoring to know that abstracting out repetition and near-repetition (i.e. highly similar methods or functions or objects) is a big part of it. So *if* the repetition in code scales, then it's a fractal, basically, and that means you can measure its fractal dimension, and that means you can compute objective measures of cruft. By which I mean (ideally) *useful*objective measures of cruft. I already have stuff that can tell you "you have 44 methods/functions which are highly similar to one another" and group clusters of similar code, but on any kind of nontrivial code base the report for that could end up almost as complex as the code itself. Fractal dimensionality probably isn't actually the most useful metric, you're probably way better off in practical terms with one of those hub-spoke node graphs like Google Wonder Wheel ( http://www.google.com/search?hl=en&tbs=ww:1&q=fractal+dimension&btnG=Search), but I really like fractals. Also, I chopped off the languages question by accident, yes, I think it's very very likely that languages differ both by degrees of repetition and by specific patterns of repetition, and indeed a big part of my perspective on this is shaped by the fact that I write a lot of Ruby and the Ruby community is sometimes a little obsessive about eliminating repetition. Also I wouldn't be surprised if it turned out to be mathematically provable that Scheme and Scheme-like Lisps enable more repetition-elimination than any other language, through their macro systems, although I have absolutely zero proof. Just speaking off the top of my head there. Nick said: *This relates to a discussion I keep trying to start in the evo-devo seminar about a possible metaphor between the modularity in biological development/evolution and modularity in the history of computer coding. Apparently, from the resistance I am getting there is no useful metaphor.* Sounds like a useful metaphor to me. I think the paper Russell linked is relevant: http://pandora.nla.gov.au/pan/10178/20040710-0000/www.complexity.org.au/ci/vol06/halloy/index.html -- Giles Bowkett http://gilesbowkett.com
============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College lectures, archives, unsubscribe, maps at http://www.friam.org
