Drawing Software Designs

2007-03-04, , Comments

Here’s Exercise 4.45 from the Wizard Book.

The following sentence can be parsed in five different ways: “The professor lectures to the student in the class with the cat.” Give the five parses and explain the differences in shades of meaning among them.

You can find a formal representation of the five parses at the end of this post. I found it easiest to describe the different shades of meaning with a diagram.

The Different Shades of Meaning

The cat, the class, the student, the professor

Drawing as a Design Tool

I use drawings all the time when I’m writing software. Pencil and paper are good enough for many jobs; whiteboard and pen are perfect for others. I enjoy using these tools and they allow me to communicate ideas very efficiently — when you work in this way, you soon build a Pictionary-style rapport with colleagues, and a simple rectangle becomes a class, or a server, or an item on a queue, or anything else you want it to be.

Often, the drawings themselves are ephemeral. It’s the act of producing the picture which shapes the design. There’s never been any question of feeding the drawing into the computer and having it generate code. (Though the reverse trip sometimes works: given source code, a computer can sketch a hyper-linked class heirarchy, for example). Similarly, I’ve never seen real benefits from the various corners of the UML syntax. Please, keep it simple.

If you hit on a drawing you do want to save, there’s no need to transpose it into a computer drawing package; that’s sure to take time and risks stifling the picture. Instead, just scan in or photograph the original and put it on the wiki.

Computer Drawing Packages

Computer drawing packages generally leave me cold. They really don’t seem to have moved on since the version of Mac Draw I encountered over twenty years ago, back when a mouse was a novel input device. It took me about 10 minutes to draw the picture above by hand, of which most of the time was spent thinking. Using a computer, I should think it would have taken well over an hour, of which most of my time would have been spent cursing.

The one thing I do like about computer drawing packages is that they allow you to animate a drawing — for example to replay it, starting from a blank page, adding features in turn. I’ve seen this technique used very effectively in presentations. Building these pictures is, however, a painful process.

The Five Parses

For the record, the five different parses are:

;; 1st parse
(sentence
  (simple-noun-phrase
    (article the) (noun professor))
  (verb-phrase
    (verb-phrase
      (verb-phrase
        (verb lectures)
        (prep-phrase
          (prep to)
          (simple-noun-phrase (article the) (noun student))))
      (prep-phrase
        (prep in)
        (simple-noun-phrase (article the) (noun class))))
    (prep-phrase
      (prep with)
      (simple-noun-phrase (article the) (noun cat)))))

;; 2nd parse
(sentence
  (simple-noun-phrase (article the) (noun professor))
  (verb-phrase
    (verb-phrase
      (verb lectures)
      (prep-phrase
        (prep to)
        (simple-noun-phrase (article the) (noun student))))
    (prep-phrase
      (prep in)
      (noun-phrase
        (simple-noun-phrase (article the) (noun class))
        (prep-phrase 
           (prep with) 
           (simple-noun-phrase (article the) (noun cat)))))))

;; 3rd parse
(sentence
  (simple-noun-phrase (article the) (noun professor))
  (verb-phrase
    (verb-phrase
      (verb lectures)
      (prep-phrase
        (prep to)
        (noun-phrase
          (simple-noun-phrase (article the) (noun student))
          (prep-phrase
            (prep in)
            (simple-noun-phrase (article the) (noun class))))))
    (prep-phrase
      (prep with)
      (simple-noun-phrase (article the) (noun cat)))))

;; 4th parse
(sentence
  (simple-noun-phrase (article the) (noun professor))
  (verb-phrase
    (verb lectures)
    (prep-phrase
      (prep to)
      (noun-phrase
        (noun-phrase
          (simple-noun-phrase (article the) (noun student))
          (prep-phrase 
            (prep in)
            (simple-noun-phrase (article the) (noun class))))
        (prep-phrase 
          (prep with) 
          (simple-noun-phrase (article the) (noun cat)))))))

;; 5th parse
(sentence
  (simple-noun-phrase (article the) (noun professor))
  (verb-phrase
    (verb lectures)
    (prep-phrase
      (prep to)
      (noun-phrase
        (simple-noun-phrase (article the) (noun student))
        (prep-phrase
          (prep in)
          (noun-phrase
            (simple-noun-phrase (article the) (noun class))
            (prep-phrase
              (prep with)
              (simple-noun-phrase (article the) (noun cat)))))))))

Feedback