Frontier Software

Robert Laing's programing notes

Data-Driven Design

By Robert Laing

Data-driven Design

Via a textbook freely available online, How to Design Programs and probably the MooC I recommend most highly by Gregor Kiczales based on that book, I’ve gained some familiarity with one of the Lisps, Racket. Another MooC, General Game Playing introduced me to Prolog, with SWI Prolog the open source version I settled on.

My experience developing Joe Blog and reading event data formats supplied mainly by Facebook has taught me researching data formats and picking the one best documented is more important than the choice of programming language.

Design top-down, build bottom-up

The design of a program proceeds in a top-down planning phase followed by a bottom-up construction phase. We explicitly show how the interface to libraries dictates the shape of certain program elements. In particular, the very first phase of a program design yields a wish list of functions. While the concept of a wish list exists in the first edition, this second edition treats it as an explicit design element. — How To Design Programs

A gripe I have with many of the “teach yourself X programming language* courses I’ve done is they encourage myopia by getting students to write little functions which do the same as existing builtins, only less efficiently.

One of the things I like about How To Design Programs is it quickly gets students writing video games, big projects which might seem overwhelming to a novice, but are actually quite easy once you learn to divide and conquer.

To stop student’s freezing, the textbook gets students to follow a six step design recipe which distills various methodologies such as Test Driven Development, Design by Contract, Design Patterns

A criticism I have is that it doesn’t teach modularity. While two libraries (packages in Racket jargon) — image.rkt and universe.rkt — are used extensively, students put everything into a single file. Luckily, a precis of Edward Yourdon’s and Larry L. Constantine’s Structured Design is freely available online.

The design recipe encourages producing reference documentation in tandem with code. Students use Racket via a GUI app, Dr Racket, which provides a text editor and some other tools. It doesn’t have a document generation system as far as I know, so novice programmers are protected from the bewildering racket of tools available for, say, JavaScript.

I’ve used the six steps of the design recipe to structure the next six chapters, applying the basic ideas of How To Design Programs outside of Dr Racket by using the automatic document generation tools and unit testing frameworks in various languages.

Last updated on 1 Jan 2021
Published on 1 Jan 2021

Content Footer