π When you need to make small changes to existing code, hereβs a pro tip π
β Donβt do this: Try to describe all the changes in a long prompt - itβs error-prone and the AI may misunderstand the context. Youβll end up trying and failing multiple times. π©
β Do this instead: Go through your code and add clear TODO comments, like:
// TODO: Add request validation to this endpoint
// TODO: Make this method take an extra parameter
// TODO: Refactor this to use async APIs
Then use a prompt like:
Go through the code and collect all TODO items, then for each item implement the changes and update the tests.
π― Why it works:
- The AI has extra context right in the code
- You get more predictable and accurate changes
Try it out - itβs a simple shift that makes a huge difference in codegen workflows. πͺ
π Let me know your experiences or tricks in the comments!
Originally posted on LinkedIn.