Rather than have a specific topic for this post I will present an idea that is still germinating in my head.
There is a problem with reusability in programming. For a competent programmer code can be found in libraries that can be made to do what you want. But this limits innovation to a programmer with many years of experience. Dabbling tinkerers have a huge learning curve before being able to produce something viable. And even after producing viable work the resulting code base is usually difficult to manipulate.
I recently took a jaunt into Second Life where I was intrigued to see prims and scripts. A prim is a primitive object one that can be used together with other prims to create larger products. A script is a small snippet of code that allows a certain action on an object. Part of what intrigued me was in Second Life you collect these as physical objects. I entered IBM's lab and found scripts for rotating an object on touch and getting information on other sims. I accessed these objects and they were added to my inventory.
As far as I saw the code snippets being traded were only useful within Second Life in the animating of objects. But I wonder if code snippets could be packaged in similar ways.
Part of the problem with libraries is the snowballing of dependencies. One library depends on another and needs code from another until it is a large unweildy mass difficult to install and use. Even after you've installed it, you have a good mountain of documentation to read before you can begin playing with your new tool. Even after reading the documentation, you still don't have a whole picture of how the system really works (documentation is notoriously difficult to understand). It's like working a puzzle but you can't figure out where the pieces edges are. It's possible (often with a lot of trial and error), but difficult and you may force the pieces into configurations they shouldn't be.
Part of my vision for the future stems from my work with LISP. I was developing a webserver (for the fun of it) using an example I found on the web. I said to myself "now how can I code up a server system and configure it?" The answer presented itself simply, bolt a system called hunchentoot (yeah difficult to spell and remember) into your code and poof it does the webserver system. No configuration it just works. It is completely self-contained and just worked.
Not all LISP systems work this well, unfortunately it suffers from the minds of the programmers designing things for it. But it is more resistant to those problems because of the mantra of "Functional Programming". Part of functional programming defines that a function DOES NOT modify anything outside of the function itself. When I read this requirement first I couldn't help but think, "Who the heck can code a system with only functional functions, where does stuff get done?" It turns out if you code all your functions functionally (that's just weird to say) then the work gets done in the function you started out with. This is contrary to the opinion that you should call out to other functions to do the work you should be doing.
From functional programming you get so many tangible benefits that it is hard to ignore the system even if it is harder. You get functions that are completely contained so you can test every input into them and verify it works under all conditions (or at least all the ones you test). You can be certain then, that if your function sends data to a function and you don't get back what you want it's your function's problem. It simplfies all debugging. Also it allows you to define certainly
1) What your inputs are
2) What your outputs are (including the truth that there were no other changes)
If you have these two things. You can model them. Imagine seeing a block of code in a 3D space it has female connectors showing where you have to input data. It has a male connector showing what data it outputs. It might even have a TV screen rather than a male connector showing that it outputs data to a screen. Or a spinning world indicating that the output is a webpage. Imagine how you could plug those things together to create even bigger systems that (as long as the new peices you added do what they say... should work). Imagine creating new objects, writing code that you will eventually see tangibly. Imagine building standardized test frameworks that you can plug your object into and be certain it will get a barrage of standard tests done to it testing all boundaries of data. So you can be relatively certain that it will not fail under any conditions (it may not produce the result you wanted, but it's up to you to check that).
I see that world and would like to help it come about.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment