03 May 2006

Worksheets revisited

I'm convinced that worksheets have not just a place but a central place in IDEs.

Here's the idea. A worksheet is a document that contains code. It's not like Excel: the code is visible all the time. But like Excel, it's "live": it runs the code as needed and displays the results right there on the page. If you edit some code, the worksheet automatically recompiles it and recalculates any affected results throughout the sheet.

The worksheet runs in a sandbox. It has access to useful testing resources—read access to other files in the same project, write access to a temp directory, and so on—but nothing much else.

Unlike a source file, the code in a worksheet doesn't have to be complete classes. Just a statement or an expression is enough. If you type an expression, the worksheet automatically shows you the result. If it's an object, it's displayed as some kind of nicely expandable, inspectable GUI widget. It's integrated with the debugger, of course.

It's also integrated with a word processor, so you can mix text and pictures with your code. None of this is meant to replace traditional source code; you'll have worksheets in your project alongside source files.

I don't know of any existing IDEs that have anything like this. But it sounds ideal for proof-of-concept demonstrations, API documentation, teaching, and testing.

My next side project is going into this territory. I'm kind of excited about it.

No comments: