Two ways to build the same app

Imagine building Recall in layers:

First   all the database tables
Then    all the server code
Then    all the pages

Now imagine building it in slices:

First   one card in the database, one page that shows it
Then    a form that adds a card
Then    the review screen

Both end in the same place. They are not equally good.

The problem with layers

Build all the tables first and ask yourself: is it right?

You cannot know. Nothing uses them yet. You are looking at a design and guessing. You will
find out whether the design works in three days, when you build the pages, and by then the
mistake is buried under everything built on top of it.

With slices, you find out in ten minutes, because something on screen is either right or
wrong.

Why this matters much more with an agent

An agent will happily build all three layers in one go if you ask. It is fast, it looks
impressive, and you are now holding several hundred lines of code that has never run.

Reviewing that is miserable. You will skim it. Skimming is how mistakes get in.

Ask for work in pieces small enough that you are still willing to read them.

That size is smaller than you think. It is roughly one screen of changes.

The slices for Recall

Look again at your step list from Lesson 2.6. Notice that it is already in slices:

  • Step 2 and 3 together are a slice: a card exists in the database, and a page shows it.
  • Step 4 is a slice: a form puts a card in.
  • Step 7 is a slice: the review screen changes a card’s next date.

Each one ends with something you can look at.

One exception, and it is important

Step 6, the scheduling function, is built alone, with no screen.

That looks like it breaks the rule. It does not. The rule is “end with something you can
check”, and a function with numbers going in and numbers coming out is the easiest thing in
this whole project to check. You do not need a screen to see whether a gap of 10 days
becomes 12.

Pull the hard part out where you can look at it directly. That is the same idea, not an
exception to it.

Try this before the next lesson

  1. Take your step list. Mark each step with what you would look at to check it.
  2. Find any step where the answer is “I would have to read the code”. Split it.
  3. Which step do you expect the agent to get wrong? Write it down. You checked this in
    Module 2 as well. Has your guess changed?