The last three days I was visiting the conference Advanced Visual Interfaces in Naples, where a lot of interesting presentations were given. The most hyped technologies were tabletops using multi-touch interfaces. Some of the more advanced examples like the one from Austria, that mixed pen and multi touch gestures in surface based applications, were really stunning and reminded one more and more of the visions expressed in the movie Minority Report).
But actually, this is not I want to talk about today.
At the conference, there was a nice talk about so called slit-tears which are small user-drawn slits which are used to extract a defined part of a video stream. So, enabling users to concentrate on relevant occurrences, solves a real world problem (which is, for example, easily counting the number of people crossing an intersection recorded by a camera).
This simple idea was cited multiple times later at the conference as a novelty. And so there is this simplicity phenomenon again: Simple ideas, which are effectively solving a real world problem, are so valuable because everyone can remember a) the solution method and b) the problem it solves. If the problem that it solves is simple, too (which it was in that case, it solved the problem of stupidly analyzing a video stream by looking at it), then it can be said that it is a great solution.
So this is about a simple, and hopefully great idea to reuse software.
I posted some ideas about code reuse last year (time is slipping by … ) and had some more today after professer Alan Dix stated twice more or less between the lines: “There is so much great code produced, but actually it is too hard to (re)use it”.
Regarding this problem, I had two visions after leaving the conference:
The first point is simply a matter of time. Software that makes, huge, unlimited design spaces available (in 2D or 3D) like Seadragon is appearing and starts being used by graphic artist in table tops for example. These design spaces will merge together with graphical representations of code as soon we will find ways to understand the aspects of modularity. I’ve not seen so much promising results in the area of visual programming languages, but may be this book about formalizing visual languages is a start. Of course, some others like Microsoft and are doing research in this field too, but I think that the transportation of classic metaphors will not be sufficient.
The second point is reuse. And here is my idea: In .NET for example meta data is available for each compiled function, class and namespace. Using libraries like Cecil, a minimum type requirement can be computed for each function and class.
This information can then be used to visualize the essential context requirements of a function. The essential context requirement are all signature fragments which are actually referred. For example: If there is a function that increases the X coordinate of a point, it only refers a structure that contains a X coordinate. This function can also be used on structures that additionally contain an Z coordinate, for example. This is similar to dynamically typed languages.
After the function has proven to be compatible within the context of your program, and after the actual types in your program (which must be a superset of the type requirements implicitly stated by the function), are compatible, the function can now be automatically (statically, given full performance and type checked) recompiled from meta data into the target environment. This is similar to C++ templates, but here, with proper documentation, we may (re)use the meta data (IL) of any compiled code base to create new software products by reuse.
A last world: I would encourage everyone to try to reuse code now, but I know how hard this is from my own experience. The difference in the future is, that code will evolve. When you then grab a sorting function from an evolved pool which has been reused and adjusted for minimum context requirements uncountable times, and so reflects the work of hundreds of developers, you then can be sure that it will meet your requirements in terms of performance, reusability and aesthetics.
yours
armin