HagiCode Fullstack

添加一个功能

Draft: this lesson is an outline and will be expanded.

The first Python version works, so now you extend it. The skill you practise here is asking for a change in a language you do not read. You describe the result you want, and you check it by using the program, not by reading its code.

The rule stays the same: ask for one change, check it, then save a checkpoint.

What you will do

  1. Choose one small feature. For a script it might be “also write a short report of what it did”. For an app it might be “let me search the entries”.
  2. Write the feature as one sentence that says what you will see when it works.
  3. Save a checkpoint before you ask, so that you can go back.
  4. Ask the AI for the feature. Add: “Change only what is needed for this feature, and tell me which files you changed.”
  5. Read the list of changed files. If it changed many files for a small feature, ask why.
  6. Run the program again and test the new feature.
  7. Test one thing that worked before, to make sure it still works.
  8. If anything broke, go back to the checkpoint and ask again with more precise words. If all works, save a checkpoint that names the feature.

Check yourself

  • The new feature does what your sentence said.
  • One thing that worked before still works.
  • You know which files the AI changed and saved a checkpoint.