Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Plan Before You Prompt  ›  Lesson

Slice the Work Thin

Plan before you Code 12 minBuild in small end-to-end slices that you can demo, review and undo, instead of finishing whole layers before anything works.

Slice the Work Thin

With a spec in hand, it is tempting to paste the whole thing into the assistant and say "build this". You would get a big pile of code across a dozen files, and when something is wrong, and something will be, you would have no idea which part caused it. The fix is to build Kitty in thin slices.

The rule

Build one thin working slice at a time, each one checkable.

A slice is a small piece of the app that works from end to end: something goes in on a page, gets stored, and comes back out. It touches every layer a little, instead of finishing one layer completely before starting the next.

Compare two ways to build Kitty:

  • In layers: design every database table, then write every page, then all the logic. Nothing works until the very end, and mistakes pile up unseen.
  • In slices: first "log one expense and see it listed". It needs one table, one form and one list, and you can try it today.

Kitty's spec becomes a queue of slices:

  1. Log an expense and see it in a list.
  2. Split each expense evenly and show everyone's share.
  3. Show who owes whom.
  4. Record a settle-up payment.
  5. Give each flat its own accounts.

Slices suit AI assistants especially well. A small request produces a small change that you can read in a few minutes, try straight away, and undo cleanly if it is wrong. A big request produces changes too large to review properly, so you end up skimming, which is how bugs slip in.

The shortcut

Use the one-minute demo test: when this slice is done, could you show it to a flatmate in one minute and one sentence? If you cannot demo it, it is a layer, not a slice. If the sentence needs several "and"s, cut it at each "and".

Slicing "show who owes whom"Step 1 of 4
  1. Try the one-sentence demo

    "Kitty shows who owes whom, simplified to the fewest payments, across all expenses and settle-ups." Too many parts for one slice.

The trap is a slice that sounds small but hides a layer, such as "set up the database for everything". Ask what you could demo afterwards; if the answer is "nothing yet", it is not a slice.

Drills

Answer fast — trust the rule.

quick drill

Which of these is a thin slice of Kitty?

quick drill

Why do small slices suit AI assistants especially well?

quick drill

Asha paid ₹900 for groceries shared evenly by three flatmates. What are the net balances?

quick drill

A slice is described as "accounts and flats and invitations and password reset". What does the shortcut say?

Remember

  • Rule: build one thin working slice at a time, each one checkable.
  • Shortcut: the one-minute demo test. Too many "and"s means cut.
  • Trap: a "slice" that is secretly a layer, with nothing to demo when it is done.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainPlan the slices

Kitty needs user accounts so that each flat sees only its own expenses. Break this into at least three thin slices, say how you would demo each one in a minute, and explain why this order is safer when an AI assistant writes the code.