Previous: , Up: Introduction   [Contents][Index]


16.3.3 A New Approach

The Lisp Style of Programming

One of the aims of this book is to explain not just the Lisp language, but the new approach to programming that Lisp makes possible. As programming environments grow in power, and languages become more abstract, the Lisp style of programming is gradually replacing the old plan-and-implement model.

Reduce the Cost of Mistakes—Increase Exploration

It would be safer to bet that specifications will be misquided, and that code will be full of bugs. This is what the new model of programming assumes. Instead of hoping that people won’t make mistakes, it tries to make the cost of mistakes very low. The cost of a mistake is the time required to correct it. With powerful languages and good programming environments, this cost can be greatly reduced. Programming style can then depend less on planning and more on exploration.

Planning is a necessary evil. It is a respone to risk: the more dangerous an undertaking, the more important it is to plan ahead. Powerful tools decrease risk, and so decrease the need for planning. The design of your program can then benefit from what is probably the most useful source of information available: the experience of implementing it.

Rapid Prototyping—Not Specifications

Lisp style has been evolving in this direction since the 1960s. You can write prototypes so quickly in Lisp that you can go through several iterations of design and implementation before you would, in the old model, have even finished writing out the specifications. You don’t have to worry so much about design flaws, because you discover them a lot sooner. Nor do you have to worry so much about bugs. When you program in a functional style, bugs can only have a local effect. When you use a very abstract language, some bugs (e.g., dangling pointers) are no longer possible, and what remain are easy to find, because your programs are so much shorter. And when you have an interactive environment, you can correct bugs instantly, instead of enduring a long cycle of editing, compiling and testing.

Lisp style has evolved this way because it yields results. Less planning can mean better design. More powerful tools are taking the risk out of exploration. That’s good news for programmers, because it means that we will be able to undertake more ambitious projects.


Previous: New Techniques, Up: Introduction   [Contents][Index]