Systematic world design in JavaScript

In the previous article, we discussed systematic data design: a test, example, and documentation-driven approach to designing functions using the HtDP methodology.

In this three-part series, we are covering systematic design as it applies to:

  1. Functions
  2. Data
  3. Worlds

Let’s now turn our attention to the design of worlds.

What is a world?

A world is simply the program your functions and data live in. In larger programs, it could also refer to a particular module or package.

World planning

This aspect of systematic design has nothing to do with code and it should precede data and function design. When thinking about the design of a world, we must think of:

  1. What data in my world will not change? In other words, what is constant?
  2. What data in my world will change?
  3. What functions will I need to bring about those changes?
  4. Illustrate or describe the possible states.

Constants and configuration

What about my program doesn’t change? What will be constant? List those things.

Changing data

What changes in my program? What kinds of changes?

Show worksheet.

What do you think? Submit a change/correction.

Up next:

Marc is the co-author of Node.js in Action and Node.js in Practice. He enjoys learning and writes technical stuff here and for IBM. Currently plays around with Go, TypeScript and Rust. Works as a full-stack engineer for @applieddataconsultants.