One of the most popular items on this blog is “No User-Serviceable Parts Inside“, which is about how nice it would be for a user to take a program and pull it to pieces to find out how it works (just as is possible with a washing machine or a car engine). Anyway, I’ve been mulling over this for a while, and I realised something the other day.
View Source
All internet browsers contain a command called “View Source” which allows the user to see the details behind a web page (try it – you can probably right-click on this article and see something like “View Page Source”. Select it and a new window will open containing HTML – the language of the web page you were viewing).
About 20 years ago I was involved in research into programming languages and tools. One of the ideas I was working on (along with many others) was called “Reflection” – which means the ability for software to answer “questions” about itself. So you could ask a”component” simple things like “what’s your name?”, “What colour are you?” and so on. An extreme form of “reflection” is to answer the question “Show me your source code”.
In principle (and also in practice in a few cases), it would be possible to “click” on a programming component such as a button, and ask the component to tell you about itself, including what happens when it’s “clicked”. A new window would open up, displaying a diagram or real source code in the original programming language (or a different one of your choice).
Students Rarely Build Big Things
For someone trying to learn how to build complex systems, one of the best ways of learning is “modelling” something which already exists. Sadly, very few text books have real examples of production-quality source text, rather than just tiny examples. There is a HUGE difference between a well-designed component which forms part of 100,000+ line project and the sort of 20-line example which is usually shown in books. Developers generally only get to experience this is as part of a team working on a large project. Which is difficult if you don’t already have a job as a developer on a large project.
Watching the Wheels Go Round

Wouldn't it be great to be able to watch what's going on inside?
Another possibility would be the ability to “step” through the source, just as is possible with modern debuggers. This way the user could step in and out of different components (and even go back up to do something again!). This “dynamic” understanding is often easier than static understanding. Colours could be used to show the “hottest” (i.e. most called) elements.
Is this Doable?
Well, most of the technology for doing this has been around for 20 years or more. The increase in processor speed and memory now means it’s a realistic proposition for many pieces of real software.
Doesn’t Open Source Let us Do this Anyway?
One of my readers commented that open source answers some of these requirements. However, just as learning to write is harder than learning to read, so writing programs is much harder than reading them, and acquiring the basic knowledge to get started can put many people off. Before writing a line of source text, a budding developer has to learn a lot of “additional” skills, such as downloading and installing compilers, source code control systems and other such tools.
This would let anyone see what’s going on with minimal investment of time to get started. If they like the idea, they could then spend time getting set up.
“Look Inside”
Also, I’d love to look at snippets of code in other people’s software (a bit like Amazon’s “Look Inside” feature). A few minutes examination would either give me increased confidence or scare the living daylights out of me. Clean, well written software should be at least partially legible by anyone, even non-programmers.
I’m thinking of implementing this in a feature in one of our products for fun. Watch this space…