The textual paradigm

Following up on yesterday’s post on code reuse, I have a more specific reason to be skeptical of literate programming.

Programming and software development is stuck in a textual paradigm – the idea that programming is something you do by writing text in a formal language. I think this idea constrains us somewhat in the development of languages and tools. IDE’s like Eclipse allow you to perform operations on the abstract syntax tree to some extent (e.g. automated refactorings), but in general, those too are text oriented.

I don’t have a replacement for the textual paradigm today. Because of the strong link between languages and automata, clearly computer programming is very strongly related to formal languages. But sentences in formal languages don’t need to be represented as text. 

However, I don’t think I want to advocate leaving text behind completely. It is one of the most powerful devices for input and output of precise information, to and from people and computers. But I think we need to take steps towards being less about text editing, and literate programming  does not seem to permit that.

Code reuse according to Knuth

I stumbled upon this interview with Donald Knuth today. In addition to the celebrated The Art of Computer Programming, Donald Knuth pioneered the concept of literate programming, which emphasises writing code for human beings to understand, as opposed to writing it for machines to understand.

When being asked about current trends and fashionable practices that have undeserved popularity, Knuth says:

I must also confess to a strong bias against the fashion for reusable code.

His take, then, is that with highly readable, modifiable and accessible source code, reuse is unnecessary and dangerous. He would prefer rewriting the code for a new context.

I am one of those who would preach the “fashion” of reusable code. It does appear to me that reusability is very important, and in particular, I think there are tremendous benefits to be realised when the language implementation is able to reason about code. The success of languages like Java shows that the more managed and controlled the language is, the more human creativity and mental capacity is free to focus on the higher levels of abstraction. If programmers must adapt code to each context manually, surely they will be distracted from the bigger task. So my take on the issue is very different to Knuth’s.

But I confess to not knowing much about literate programming and to not having explored the tools (in particular Knuth’s CWEB). Perhaps I should learn more.

Blogging revisited

This marks the launch of my second (possibly third) attempt at serious blogging. Unlike previous blogs, I intend for this one to have some specific purposes.

Primarily it will be a vehicle for me to express ideas about software and software research that I can’t express elsewhere. This will probably range from random thoughts to essayish writings. The benefit for me is that expressing myself coherently aids my thinking and understanding. In this sense the blog will be a kind of public notepad, but hopefully more well written than my notepads are.

Secondly, though surely this is too much to hope for, maybe it could attract comments from people who share my interests. Any kind of dialogue or exchange of ideas is always welcome.

This time around I use WordPress, one of the most popular blog packages. Times have changed since around 2004, when I made my own PHP/MySQL based system. At the time I had lots of free time and a kind of do-it-myself ethic. Today there is less time and no clear benefit in rolling my own. My focus should be more on the content and less on the form.

So let’s see how this instance of my blogging attempts turns out.

Technorati Profile